44. File System Interaction
Tcl provides a platform-independent C API for working with files and directories. Using these functions instead of platform-native system calls makes your code more portable. The Tcl API also automatically handles any translation required between the Tcl-native UTF representation of character strings and the system encoding; all input and output string parameters for these functions are based on Tcl-native UTF-encoded strings. Furthermore, the Tcl API automatically supports Tcl’s virtual file systems. If the paths you provide as parameters to these functions represent locations in a virtual file system that your application has mounted (for example, a ZIP archive or an FTP site), the functions can access the files ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access