chgpath [-n|-p] [-l|-u|-c|-q] path
ntpath2posix [-l|-u|-c|-q] path
posixpath2nt [-l|-u|-q] path
If called as ntpath2posix(1), it converts from Win32 format to POSIX format. If called as posixpath2nt(1), it converts from POSIX format to Win32 format.
By default, the utility maintains the case of the path, although when converting to POSIX format, it will always produce an uppercase drive letter.
These commands are normally used in shell scripts that, in turn, invoke Win32 commands.
To set the current TMP environment variable in a form that Win32 programs can understand:
export TMP=$(posixpath2nt $TMP)
To return it to the form expected by the Interix utilities:
export TMP=$(ntpath2posix $TMP)
Assuming Interix is installed in /dev/fs/C/SFU:
$ ntpath2posix -c /dev/fs/C/SFU
/dev/fs/C/SFU
The following example displays output that contains a warning:
$ chgpath -n -c /usr
chgpath: WARNING: ignoring -c flag. Converting to an NT path.
C:\SFU\usr
To suppress the warning, you can use the -q option:
$ chgpath -n -c -q /usr
C:\SFU\usr
The -c option matches the first path name component returned by readdir(3). It is not recursive, so it can be misled by file hierarchies that are very complicated. For example, suppose you have the files and directories:
C:\Something
C:\Something\BIN
C:\Something\BIN\file
C:\Something\BIn\file
C:\Something\Bin
C:\Something\Bin\MyStuff
C:\Something\Bin\MyStuff\myProg
This command will not work:
$ ntpath2posix -c C:\something\bin\mystuff\myprog
/dev/fs/C/Something/Bin/myStuff/myProg
This is still a useful option without providing a general
replacement for find(1).
The internal buffer is limited to 512 characters, so path names longer than this will not be returned correctly.
find(1)