Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Facilitate Directory Operations with the <dirent.h> and <dir.h> Libraries

Because standard C++ doesn't have a library for manipulating directories, programmers are forced to use workarounds that waste their time and compromise code portability. Thankfully, you can use the quasi-standard <dirent.h> and <dir.h> libraries to manipulate directories in a portable and platform-neutral fashion.


advertisement
isk defragmenters, antiviruses, backup utilities, and file compression tools are a few examples of applications that operate on directories. Alas, standard C++ doesn't have a library for manipulating directories. Consequently, programmers resort to third-party libraries and platform-dependent hacks for mundane operations such as listing files in a directory, creating new directories, and deleting directory files. These workarounds compromise code portability and force developers to learn different libraries every time. Thankfully, you can use the quasi-standard <dirent.h> and <dir.h> libraries to manipulate directories in a portable and platform-neutral fashion.


How can you operate on directories using a portable and standardized library?


Use the <dirent.h> and <dir.h> libraries to list directory files and perform other directory-related operations.



Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap