Pelles C > Feature requests

Missing _wopendir()

<< < (2/3) > >>

John Z:
Hi Mul,

Thanks - I understand now what you are looking for with that function  :)
If it existed I'd probably have used it too. 

I used a workaround in a Windows GUI program, that might also work
in a Windows Console program although I've not tried it there. But it is
only for Windows so it may be of no help.  I use an "invisible" Dir box to
get Unicode directory listing for directories.  Definitely more overhead than
the function call - but sometimes you just gotta get it done anyway you can.

RetVal = DlgDirListW(hwndDlg,p_data,DirBox,Invisible,DDL_DIRECTORY);

Then I can process the list of directories as needed.


Regards,
John Z

Stefan Pendl:
Why not use the Windows API for getting the short, 8.3, path?
In general all foreign, not English, folder names are only junctions that point to the English folders since Windows 7, use "dir /a" in a command prompt.
If the code is not cross platform using system functions of the operating system API would be a good workaround until the functions for wide characters are available.
In addition you could use the regular findfirst, findnext, etc. functions.

John Z:
Thanks Stefan,

One issue with that approach is if you use, for instance, a recent directory list similar to a recent file list. The end user would be confused by the 8.3 which looks nothing like the non-English directory name.

John Z

Stefan Pendl:
OK, so for display one could use the long path, which is already present, since we got the short path from it.
The best approach until Pelle has decided to implement the wide character functions, is to build wrappers on your own that mimic the missing functions, using the _wfindfirst64, _wfindnext64 and _findclose functions.

TimoVJL:
Support routines:
https://github.com/tronkko/dirent/blob/master/include/dirent.h

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version