开发者

How to list and manipulate windows files using C only?

开发者 https://www.devze.com 2023-02-08 05:25 出处:网络
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 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消