winepath, there's different configuration options for it.
With regards to another related question you asked which I answered, you can use
winepath to find the Windows-compatible path for a given Linux path direction.
winepath is only really useful with specific arguments passed, as the different arguments it accepts actually tell it what you are looking for.
winepath accepts a bunch of useful arguments, of which
-w are most useful here. This is from the
winepath manpage from the 3.4 development version of Wine:
converts a Windows path to a Unix path.
converts a Unix path to a long Windows path.
With these in mind, we can get
/tmp/test/0.pdf into a useful Windows path. (I'm using
/tmp/blah.txt in my example though)
Convert a Unix path to a long Windows path - what you had to do in your other question - which then is something you can pass to a Windows executable, and is based on your
winecfg drive mapping (it takes a few minutes to run):
$ winepath -w /tmp/blah.txt
Convert a Windows long path to a Unix filepath - the inverse of what you needed to do, but what is actually useful if you have something installed in the Wine
C:\ drive and need to the Linux file path to the file/executable/folder/etc. This helps you if you need to edit something in a path that you're not aware of where it sits on disk, namely usually in
~/.wine/drive_c and such because there's a lot of things you might need direct folder access for. For your example, below, it's not real useful, since we know already intrinsically that
Z: is mapped to
/ on your system. However, you can technically access the file via the full Wine Linux path below (which works, because
~/.wine/dosdevices/z: is actually just a symlink for
/ in your setup, and mine):
$ winepath -u 'Z:\tmp\test\0.pdf'
This seems to be the 'default' - it takes a Windows path and outputs the Linux equivalent for the Windows file path with regards to the existing Wine installation.
Your primary use cases, therefore, are:
To take a Unix filesystem path and get the Windows-style path with regards to the Drive setup in your Wine Prefix; this is what you would have to enter to get the answer in the other question you posted. (since you can't use Unix paths in Windows executables' arguments, or in an Open dialog in a Wine-opened executable, since those need Windows style paths)
To take a Wine-based Windows path and get the corresponding Linux filesystem path so you can interact with the file in the standard Linux system directly (since you can't use Windows paths in Unix to interact with the files in the Ubuntu operating system directly)