Do you know how to delete a file thorugh code???

Non-platform specific questions.

Do you know how to delete a file thorugh code???

Postby Bee-Ant » Mon Aug 03, 2009 11:53 am

Give it to me...yeah...
No one gonna show me...how??? :P

*give the answer I mean*
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: Do you know how to delete a file thorugh code???

Postby DST » Mon Aug 03, 2009 8:24 pm

I don't think you can.

You could perhaps overwrite the variables saved in a file, or perhaps write blanks to a text file, but I believe that GE is designed so you can't write harmful programs with it, that could delete external files.
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: Do you know how to delete a file thorugh code???

Postby Bee-Ant » Mon Aug 03, 2009 10:15 pm

Well, just like what i've expected...
Then how do I replace the whole text with a blank text?
*play dumb* :P
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: Do you know how to delete a file thorugh code???

Postby skydereign » Mon Aug 03, 2009 10:44 pm

Open it with fopen and set the mode to w. Then close it.
Code: Select all
FILE test = *fopen("filename", "w");
fclose(test);
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Do you know how to delete a file thorugh code???

Postby Bee-Ant » Tue Aug 04, 2009 12:35 am

"w" stands for write right?
Hmmm...logically...it would write an empty string.
Okay, thanks :D
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron