file system

file system name

Returns a list of two elements, the first of which is the name of the filesystem to use for the file, and the second an arbitrary string representing the filesystem-specific nature or type of the location within that filesystem. If a filesystem only supports one type of file, the second element may be null. For example the native files have a first element 'native', and a second element which is a platform-specific type name for the file's system (e.g. 'NTFS', 'FAT', etc), or possibly the empty string if no further information is available or if this is not implemented. A generic virtual file system might return the list 'vfs ftp' to represent a file on a remote ftp site mounted as a virtual filesystem through an extension called 'vfs'. If the file does not belong to any filesystem, an error is generated.


In Tcl's core file system always returns just "native" on Unix, MacOS, because the platform-specific filesystems do not implement further details. On Windows, "native NTFS" or "native FAT" is returned, depending on the disk. It would be useful to update MacOS with 'HFS' or 'HFS+' or 'iDisk' etc. and Unix with 'NFS' or 'FAT32' etc...

Is anyone interested in contributing code to do this on any of these platforms? The code simply needs to take a Tcl_Obj representation of a path, and return a Tcl_Obj containing a string with the system type. (see TclpFilesystemPathType in tcl(Unix|Mac)File.c)


What's the meaning of the argument name? I've tried file system dummfug, and the function returned the same value as with file system win. Is it a dummy argument? - RS: no - e.g. on Windows XP I see

 % file system d:
 native NTFS
 % file system e:
 native CDFS

See also