Help needed with files (solved)

You must understand the Game Editor concepts, before post here.

Help needed with files (solved)

Postby lcl » Thu Aug 04, 2011 1:24 pm

Can someone please help me to clear a text file which is created by GE.
I am making an internet bookmark application which stores bookmarks into file
with their web address and name, and then loads them from it.
I just want to add ability to remove bookmarks, and that's why I need to get the file
cleared and then write the bookmarks again.

So, does anyone know a way to clear a file? :D
Last edited by lcl on Thu Aug 04, 2011 6:02 pm, edited 1 time in total.
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: Help needed with files

Postby Game A Gogo » Thu Aug 04, 2011 5:58 pm

when using fopen, instead of having the "r+b" parameter, have "w+b", it will create a new file to write to, it may be possible that you do not have the +b
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Help needed with files

Postby lcl » Thu Aug 04, 2011 5:59 pm

Thanks, GAG, got to try that :D

EDIT:
Thank you so much, that worked perfectly!
I had struggled with that problem for hours! :lol:
+1 to you!
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest

cron