{"record":{"id":"33b49ec355e832dc","repo":"nodejs/node","slug":"u-file-access-error-33b49e","errorCode":"U_FILE_ACCESS_ERROR","errorMessage":"genccode: unable to open input file %s\n","messagePattern":"genccode: unable to open input file (.+?)\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/toolutil/pkg_genc.cpp","lineNumber":337,"sourceCode":"writeAssemblyCode(\n        const char *filename,\n        const char *destdir,\n        const char *optEntryPoint,\n        const char *optFilename,\n        char *outFilePath,\n        size_t outFilePathCapacity) {\n    uint32_t column = MAX_COLUMN;\n    char entry[96];\n    union {\n        uint32_t uint32s[1024];\n        char chars[4096];\n    } buffer;\n    FileStream *in, *out;\n    size_t i, length, count;\n\n    in=T_FileStream_open(filename, \"rb\");\n    if(in==nullptr) {\n        fprintf(stderr, \"genccode: unable to open input file %s\\n\", filename);\n        exit(U_FILE_ACCESS_ERROR);\n    }\n\n    const char* newSuffix = nullptr;\n\n    if (uprv_strcmp(assemblyHeader[assemblyHeaderIndex].name, \"masm\") == 0) {\n        newSuffix = \".masm\";\n    }\n    else if (uprv_strcmp(assemblyHeader[assemblyHeaderIndex].name, \"nasm\") == 0) {\n        newSuffix = \".asm\";\n    } else {\n        newSuffix = \".S\";\n    }\n\n    getOutFilename(\n        filename,\n        destdir,\n        buffer.chars,","sourceCodeStart":319,"sourceCodeEnd":355,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/toolutil/pkg_genc.cpp#L319-L355","documentation":"Thrown by genccode's writeAssemblyCode when T_FileStream_open(filename,\"rb\") returns nullptr. The input binary file that genccode is supposed to turn into assembly cannot be opened for reading.","triggerScenarios":"At the top of writeAssemblyCode (pkg_genc.cpp:337), in=T_FileStream_open(filename,\"rb\"); nullptr triggers the message and exit(U_FILE_ACCESS_ERROR).","commonSituations":"Wrong working directory when invoking genccode; misspelled input path; input file deleted between configure and make; permission denied; NFS hiccup; the path points to a directory instead of a file.","solutions":["Verify the input file exists and is readable: ls -l <path> && test -r <path>.","Run genccode from the correct working directory or pass an absolute path.","Check the make/configure log for where the input was expected to be generated.","Restore the file from a clean checkout if it was accidentally removed."],"exampleFix":"# before\ngenccode -d out/ relative/path/data.bin  # file not found\n\n# after\ngenccode -d out/ /abs/path/to/data.bin","handlingStrategy":"validation","validationCode":"// Before invoking genccode, confirm the input file is openable for reading.\n#include <cstdio>\n#include <cstring>\n#include <cerrno>\nbool inputReadable(const char* path) {\n    FILE* f = std::fopen(path, \"rb\");\n    if (!f) { std::fprintf(stderr, \"cannot read %s: %s\\n\", path, std::strerror(errno)); return false; }\n    std::fclose(f);\n    return true;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass absolute input paths to genccode to avoid working-directory issues.","Add a 'test -r <input>' preflight in the build recipe.","Ensure prerequisite build steps that generate the input succeeded.","Keep inputs on local disk during generation."],"tags":["icu","genccode","filesystem","io","build-tool","file-not-found"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}