Jump to content
  • Advertisement


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


remove() problems on win98 and older win2k

This topic is 5456 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

I pass in a docname and replace a char with a string. I have two files open, the read file and the write file. I read a line, fix it then write it to TMP.xml and then move on. At the end after EOF, I delete the read file and rename TMP.xml to the docname. Cept, On my uptodate Win2k this works fine if(remove("docname") == -1) printf("error remove\n"); if(rename("TMP.xml",docname) printf("error rename\n"); When I copy this to a less then upto date win2k or a win98 It errors on both remove and rename. I''m just guessing, but maybe the rename error is because the remove didnt happen and the file is still there. Why would remove fail so randomly?

Share this post

Link to post
Share on other sites
NOTE to self, read all doc''s before you post here.

even though someone else here posted that if you use rename it will delete the file if it already exists was not true. It will return an error.

Also, you can''t remove read only files. I burnt the files to be removed to a disc then copyed them to the HDD, of course they still have read only attr''s=/

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!