Jump to content


file i/o question


4 replies to this topic

#1 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2718 posts

Posted 20 January 2011 - 01:36 PM

in c++, using some standard library, what library do I need and how do I delete files out of a directory programmatically?

thanks for any help.

i remember something from when i was coding when i was alot younger, is the function called "kill"?
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#2 Kenneth Gorking

    Senior Member

  • Members
  • PipPipPipPip
  • 939 posts

Posted 20 January 2011 - 02:56 PM

The CRT function is called _unlink:
http://msdn.microsof...(v=VS.100).aspx
"Stupid bug! You go squish now!!" - Homer Simpson

#3 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2718 posts

Posted 20 January 2011 - 03:00 PM

cheers.
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#4 TheNut

    Senior Member

  • Moderators
  • 1696 posts
  • LocationThornhill, ON

Posted 20 January 2011 - 03:31 PM

Visual C++ 2010 supports _unlink, but earlier versions (2008?) had to use remove(). Just something to consider if you run into issues with other compilers out there.
http://www.nutty.ca - Being a nut has its advantages.

#5 Nerd_Skywalker

    Valued Member

  • Members
  • PipPipPip
  • 215 posts

Posted 20 January 2011 - 05:50 PM

I just use remove(), just pass it the filename (including path if needed)
Re-dun-dant adj. 1. See redundant

TheNut said:

"Hmm, yes. Strong is the force with this one"





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users