Page 1 of 1

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

PostPosted: Mon Aug 03, 2009 11:53 am
by Bee-Ant
Give it to me...yeah...
No one gonna show me...how??? :P

*give the answer I mean*

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

PostPosted: Mon Aug 03, 2009 8:24 pm
by DST
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.

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

PostPosted: Mon Aug 03, 2009 10:15 pm
by Bee-Ant
Well, just like what i've expected...
Then how do I replace the whole text with a blank text?
*play dumb* :P

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

PostPosted: Mon Aug 03, 2009 10:44 pm
by skydereign
Open it with fopen and set the mode to w. Then close it.
Code: Select all
FILE test = *fopen("filename", "w");
fclose(test);

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

PostPosted: Tue Aug 04, 2009 12:35 am
by Bee-Ant
"w" stands for write right?
Hmmm...logically...it would write an empty string.
Okay, thanks :D