This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Write to temp file

Help for those learning Tcl or writing their own scripts.
Post Reply
S
ShavdApe
Halfop
Posts: 46
Joined: Mon Dec 15, 2003 5:22 pm

Write to temp file

Post by ShavdApe »

I need a bot to write to a temp file send that fiel via dcc then delete it is it even possible?

I understand how to write to a file and I also know how to dcc that file but what about delete the file is it possible?
Would I need to set a time to delete the file or could I do it after use?

Im sorry if this has been posted before but its hard to know how best to find an answer to this one. The word delete has been used many times as has the word temp or temporary.
w
willyw
Revered One
Posts: 1203
Joined: Thu Jan 15, 2009 12:55 am

Re: Write to temp file

Post by willyw »

ShavdApe wrote:I need a bot to write to a temp file send that fiel via dcc then delete it is it even possible?

I understand how to write to a file and I also know how to dcc that file but what about delete the file is it possible?
Would I need to set a time to delete the file or could I do it after use?

Im sorry if this has been posted before but its hard to know how best to find an answer to this one. The word delete has been used many times as has the word temp or temporary.
I have one script that I wrote for my own use, that can delete a file.
The line is similar to this:
if [ file exists $_filename ] {file delete $filename }

Since you said you can write to a file, that means you KNOW where the file is, and how to find it. .... you won't have any problems with deleting something you don't want to delete. :)


http://www.tcl.tk/man/tcl8.5/
and specifically:
http://www.tcl.tk/man/tcl8.5/TclCmd/file.htm#M12

were helpful to me. Maybe they will help you too.
S
ShavdApe
Halfop
Posts: 46
Joined: Mon Dec 15, 2003 5:22 pm

Post by ShavdApe »

lol typical that it would be that easy I expected the solution to be a little more difficult than that thanks for the reply appreciated. Havent tested it but if its that easy to delete then Im sure it will be fine.
w
willyw
Revered One
Posts: 1203
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

ShavdApe wrote:lol typical that it would be that easy I expected the solution to be a little more difficult than that thanks for the reply appreciated. Havent tested it but if its that easy to delete then Im sure it will be fine.
You're welcome. :)
I hope it helped.
r
raider2k
Op
Posts: 140
Joined: Tue Jan 01, 2008 10:42 am

Post by raider2k »

exec rm -f $filename

would be a different way to do it
Post Reply