All fields

“Path & OS Modules” in Information Technology

14 questions across 3 technologies.

Information Technology

14 questions in 3 technologies

#QuestionTechnologyTopicLevel
1How do path.posix and path.win32 let you work with a specific path format regardless of the operating system Node.js is actually running on? Node.js › Path & OS ModulesNode.jsPath & OS ModulesIntermediate
2What does path.parse() and path.format() do, and how are they useful for decomposing and reconstructing file paths? Node.js › Path & OS ModulesNode.jsPath & OS ModulesBeginner
3What is the difference between path.join() and path.resolve(), and when would you use each? Node.js › Path & OS ModulesNode.jsPath & OS ModulesBeginner
4How would you use the node:os module to make a script's behavior adapt correctly across different operating systems? Node.js › Path & OS ModulesNode.jsPath & OS ModulesIntermediate
5What is path traversal, and how does the path module (specifically path.normalize() and careful path.join() usage) help prevent it as a security vulnerability? Node.js › Path & OS ModulesNode.jsPath & OS ModulesAdvanced
6What does the node:os module provide, and what are some commonly used functions from it? Node.js › Core Node.js ModulesNode.jsCore Node.js ModulesBeginner
7How would you diagnose and resolve a 'split package' problem when using JPMS, where the same package is defined across two different modules on the module path? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationAdvanced
8How do you use pathlib.Path for modern, object-oriented file path manipulation instead of os.path's string-based functions? Python › File I/O & Context ManagersPythonFile I/O & Context ManagersIntermediate
9What is the difference between an absolute path and a relative path in Node.js, and how does __dirname help resolve paths reliably? Node.js › File System & File ProcessingNode.jsFile System & File ProcessingBeginner
10How do you write cross-platform shell scripts in Node.js that work identically on Windows, macOS, and Linux? Node.js › CLI Tools & Scripting with Node.jsNode.jsCLI Tools & Scripting with Node.jsIntermediate
11How do you safely watch a directory or file for changes using fs.watch(), and what are its known cross-platform limitations? Node.js › File System (fs) ModuleNode.jsFile System (fs) ModuleIntermediate
12What is the difference between __dirname/__filename in CommonJS and their equivalents in ES Modules? Node.js › Global Objects & the process ObjectNode.jsGlobal Objects & the process ObjectIntermediate
13What does it mean that Node.js's I/O is handled by libuv, and how does libuv abstract different operating systems' I/O mechanisms? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOIntermediate
14How would you recursively read all files within a directory tree in Node.js? Node.js › File System & File ProcessingNode.jsFile System & File ProcessingIntermediate