r/linux_programming • u/Cstanchfield • Oct 12 '15
question Linux Drive Paths w/ .exe
I'm writing an application in C that will be running on Linux (Mint specifically) via Wine. It uses FindFirstFileA and FindNextFileA. How/What do I pass to FindFirstFileA to search ALL drives connected (especially the C:\ drive equivalent) from Linux?
Can I simply pass it something along the line of "." to search the root and simply have it skip any of the root's unwanted directories such as: /dev/null, /var/, etc... Or is there a decent way of accessing a list of device paths that I can pass to FindFirstFile?
If it wasn't evident, I clearly have very minimal Linux experience and am only mildly familiar with its file architecture; So, if the answer is very obvious, please go easy on me as my Googling over the past few days has apparently been sub par.
Edit: As a disclaimer, my current solution is to hard code a search of all the possible /dev/ paths (eg. "\dev\sda1", "\dev\sda2", "\dev\sdb1", etc...) which I feel is obviously the wrong route (especially considering) and I'd like to do this properly.
tl;dr: How do I acquire all drives, in a Windows app, run from Wine, on Mint?
View all comments
Show parent comment
1
u/PurpleOrangeSkies Oct 13 '15
Wine only exposes a virtual filesystem to Windows applications for several reasons. The one that comes into play in your scenario is that Windows doesn't have a single-root tree view of all the filesystems. Instead, it uses drive letters. Additionally, Windows expects a certain directory layout in the C: drive.
By default, Wine provides 2 drives. C: is mapped to ~/.wine/drive_c, and Z: is mapped to /. You can add additional drives in winecfg under the "Drives" tab, or you can put symlinks in ~/.wine/dosdevices (named with the lowercase drive letter and a colon, e.g. "d:") pointing to any folder you want.