I am trying to build a program to rename a bunch of files to a specific format. Problem is, I can't figure out the best way to find, list or manipulate windows files using C (using Visual C++ 2010).
I was able to do it in C++ using FindFirstFile() but I am trying to restrict myself to C only so I'm 开发者_StackOverflow中文版looking for another solution, which will also be more compatible.
Thanks.
First, FindFirstFile()
is not a C++ function; it is a Windows function, which on Windows is also available in C (but is not available at all on other OSes)
If you want a portable solution, you can use the glib library's directory functions to list directories in a portable manner. There are functions for globbing (ie, processing wildcards) in glib as well.
精彩评论