Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Dealing with disk files

This topic is 5979 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Are there anyway to search the physical drive for certain files and display them in a console program?

Share this post

Link to post
Share on other sites
  1. Search for files and display.
    In C++ you can use the fstream objects to real from and write to files. As for determining paths and if a "file" is a directory, it''s system-specific. Under Windows, look into the <direct.h> header. Under UNIX look into <unistd.h>l, <sys/dir.h> and <sys/types.h>.

  2. Obtaining file size
    A system independent way of finding file size is to use fseek and ftell (C) or fstream::seekpos (C++; inherited from basic_filebuf).

[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! ]
Thanks to Kylotan for the idea!

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!