开发者

getting folder content C language

How can 开发者_StackOverflowi get the paths of a folder and its content. Say i have folder named MyFolder as

/tmp/MyFolder/ where it has subfolders SubFolder1, SubFolder2... and some files


You may take a look at the opendir() family functions.


A more efficient way than {open,read,close}dir() is Linux' getdirentries() function. See getdirentries(3) for details.


Use dirent and dir structures. You can use opendir(), readdir() etc for manipulation.

readdir() will give one name at a time and you can keep calling it iteratively.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜