| View previous topic :: View next topic |
| Author |
Message |
cache Master
Joined: 10 Jan 2006 Posts: 306 Location: Mass
|
Posted: Thu Sep 27, 2007 10:57 am Post subject: Delete File [SOLVED] |
|
|
Trying to make a script to delete a stats file so I can easly reset it.
I tried making this but no luck:
| Code: | bind pub - !deletestats remstats
proc remstats {nick uhost hand chan arg} {
if {[file exist scripts/dbase/statistics.dat]} {
file delete "scripts/dbase/statistics.dat"
putserv "PRIVMSG $nick :You have deleted stats"
} else {
putserv "PRIVMSG $nick :There are no stats."
}
} |
I don't get any error, just keeps saying There are no stats, even tho there is..
Last edited by cache on Thu Sep 27, 2007 3:18 pm; edited 1 time in total |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Thu Sep 27, 2007 1:01 pm Post subject: |
|
|
| Try using the full path, eg, /home/bot/whatever/scripts/etc/filename.dat |
|
| Back to top |
|
 |
cache Master
Joined: 10 Jan 2006 Posts: 306 Location: Mass
|
Posted: Thu Sep 27, 2007 1:27 pm Post subject: |
|
|
hi rosc,
I have tried the full path as well and a few other ways with no luck. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Thu Sep 27, 2007 1:38 pm Post subject: |
|
|
Have you made sure the file was not in use (opened or such) when you deleted it? _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
cache Master
Joined: 10 Jan 2006 Posts: 306 Location: Mass
|
Posted: Thu Sep 27, 2007 1:41 pm Post subject: |
|
|
| it isn't opened or in use, do you know of another sample delete script i can try? |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Thu Sep 27, 2007 1:47 pm Post subject: |
|
|
Well, your script is pretty much the way to go, unless you'd like to depend on external binaries.
I assume the file is generated by some stats-script. I take it you've double-checked that there is no way it could've held the file opened? _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
cache Master
Joined: 10 Jan 2006 Posts: 306 Location: Mass
|
Posted: Thu Sep 27, 2007 1:53 pm Post subject: |
|
|
yeah I chanset -stat to turn it off, still says theres no stats.. I willing to give other ways a try...
Just trying to make an easy delete script since some games/scripts don't come with a delete option |
|
| Back to top |
|
 |
cache Master
Joined: 10 Jan 2006 Posts: 306 Location: Mass
|
Posted: Thu Sep 27, 2007 3:07 pm Post subject: |
|
|
| i changed file ext now it works, thanks all |
|
| Back to top |
|
 |
|