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 ...

Get Tcl and the Tk Toolkit, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.