'''file nativename''' ''name'' Returns the platform-specific name of the file ''name''. This is useful if the filename is needed to pass to a platform-specific call, such as exec under Windows or AppleScript on the Macintosh. [LES]: What is the difference between '''file nativename''' and '''file normalize'''? What does '''file nativename''' do that '''file normalize''' doesn't? [RLH]: '''file normalize''' "Returns a ''unique normalised path'' representation for the file-system object (file, directory, link, etc), whose string value can be used as a unique identifier for it. " [MG] Basically, [file normalize] expands ., .. and ~ to the "proper" elements, and [file nativename] shows the platform-specific directory separators. Usually, for the purposes of displaying a path, you want to use both. For example: (Griffiths) 2 % pwd C:/Documents and Settings/Griffiths (Griffiths) 3 % set path [file join .. .. windows] ../../windows (Griffiths) 4 % file normalize $path C:/WINDOWS (Griffiths) 5 % file nativename $path ..\..\windows (Griffiths) 6 % file nativename [file normalize $path] C:\WINDOWS (Griffiths) 7 % file normalize [file nativename $path] C:/WINDOWS So, to display a path the platform-specific way, file nativename [file normalize $path] is the thing to use, as it expands everything properly. On Windows, you can go a step further, and use file nativename [file attributes [file normalize $path] -shortname] file nativename [file attributes [file normalize $path] -longname] to guarantee you get the short (MS-DOS type 8.3) names, or the longer, full/"real" file names. (You still need the ''file nativename'' on the outside, though, to get backslashes, rather than forward slashes.) [Vince] says that [[file normalize]] is guaranteed to be the 'longname', so the second example is longer than necessary. file nativename [[file normalize $path]] will do the same thing. ---- See also: * [file] ---- [Tcl syntax help] - [Category Command] - [Category Introspection]