egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Delete File [SOLVED]

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
cache
Master


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Thu Sep 27, 2007 10:57 am    Post subject: Delete File [SOLVED] Reply with quote

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
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Thu Sep 27, 2007 1:01 pm    Post subject: Reply with quote

Try using the full path, eg, /home/bot/whatever/scripts/etc/filename.dat
Back to top
View user's profile Send private message
cache
Master


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Thu Sep 27, 2007 1:27 pm    Post subject: Reply with quote

hi rosc,

I have tried the full path as well and a few other ways with no luck.
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Thu Sep 27, 2007 1:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
cache
Master


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Thu Sep 27, 2007 1:41 pm    Post subject: Reply with quote

it isn't opened or in use, do you know of another sample delete script i can try?
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Thu Sep 27, 2007 1:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
cache
Master


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Thu Sep 27, 2007 1:53 pm    Post subject: Reply with quote

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
View user's profile Send private message
cache
Master


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Thu Sep 27, 2007 3:07 pm    Post subject: Reply with quote

i changed file ext now it works, thanks all
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber