{"record":{"id":"48a667fefd58f324","repo":"denoland/deno","slug":"err-fs-cp-fifo-pipe","errorCode":"ERR_FS_CP_FIFO_PIPE","errorMessage":"Cannot copy a FIFO pipe","messagePattern":"Cannot copy a FIFO pipe","errorType":"exception","errorClass":"NodeSystemError","httpStatus":null,"severity":"error","filePath":"ext/node/polyfills/_fs/cp/cp.ts","lineNumber":108,"sourceCode":"      });\n    case \"EISDIR\":\n      throw new ERR_FS_EISDIR({\n        message: err.message,\n        path: err.path,\n        syscall: \"cp\",\n        errno: EISDIR,\n        code: \"EISDIR\",\n      });\n    case \"SOCKET\":\n      throw new ERR_FS_CP_SOCKET({\n        message: err.message,\n        path: err.path,\n        syscall: \"cp\",\n        errno: EINVAL,\n        code: \"EINVAL\",\n      });\n    case \"FIFO\":\n      throw new ERR_FS_CP_FIFO_PIPE({\n        message: err.message,\n        path: err.path,\n        syscall: \"cp\",\n        errno: EINVAL,\n        code: \"EINVAL\",\n      });\n    case \"UNKNOWN\":\n      throw new ERR_FS_CP_UNKNOWN({\n        message: err.message,\n        path: err.path,\n        syscall: \"cp\",\n        errno: EINVAL,\n        code: \"EINVAL\",\n      });\n    case \"SYMLINK_TO_SUBDIRECTORY\":\n      throw new ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY({\n        message: err.message,\n        path: err.path,","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/ext/node/polyfills/_fs/cp/cp.ts#L90-L126","documentation":"Mirror of the socket case: kind 'FIFO' from the native cp validation becomes ERR_FS_CP_FIFO_PIPE ('Cannot copy a FIFO pipe'). Named pipes (created with mkfifo) have a reader/writer semantic, not stored bytes, so copying their 'content' is meaningless and fs.cp rejects them.","triggerScenarios":"Recursive copy with dereference over a directory containing FIFOs (e.g. mpd's control pipe, logging pipes under /run); deploying a tree that includes a fixture FIFO created by a test.","commonSituations":"Packaging scripts that snapshot service runtime directories; CI caches containing named pipes created by integration tests.","solutions":["Add a filter that skips FIFOs: check stats.isFIFO()","Exclude runtime/FIFO directories from the copy set explicitly","Delete stale FIFOs before deploying over them"],"exampleFix":"// before\nawait fsp.cp(runDir, backupDir, { recursive: true, dereference: true });\n\n// after\nawait fsp.cp(runDir, backupDir, {\n  recursive: true,\n  dereference: true,\n  filter: async (s) => !(await fsp.lstat(s)).isFIFO(),\n});","handlingStrategy":"validation","validationCode":"const filter = async (s) => !(await fsp.lstat(s)).isFIFO();\nawait fsp.cp(src, dest, { recursive: true, dereference: true, filter });","typeGuard":"async function isFifoPath(p) { try { return (await fsp.lstat(p)).isFIFO(); } catch { return false; } }","tryCatchPattern":"try { await fsp.cp(src, dest, { recursive: true, dereference: true }); } catch (e) { if (e.code === 'ERR_FS_CP_FIFO_PIPE') { /* skip FIFO and retry */ } else throw e; }","preventionTips":["Filter out FIFOs on any recursive copy over runtime or fixture dirs","Recreate named pipes with mkfifo at the destination when needed","Audit test fixtures for special files before packaging"],"tags":["node-compat","fs","cp","fifo","named-pipe"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}