| View previous topic :: View next topic |
| Author |
Message |
ShavdApe Halfop
Joined: 15 Dec 2003 Posts: 46
|
Posted: Sun Oct 18, 2009 9:17 am Post subject: Write to temp file |
|
|
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. _________________ Driving lessons bolton |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Sun Oct 18, 2009 12:56 pm Post subject: Re: Write to temp file |
|
|
| 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. |
|
| Back to top |
|
 |
ShavdApe Halfop
Joined: 15 Dec 2003 Posts: 46
|
Posted: Sun Oct 18, 2009 1:09 pm Post subject: |
|
|
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. _________________ Driving lessons bolton |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Tue Oct 20, 2009 11:38 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
raider2k Op
Joined: 01 Jan 2008 Posts: 140
|
Posted: Wed Oct 21, 2009 2:52 am Post subject: |
|
|
exec rm -f $filename
would be a different way to do it |
|
| Back to top |
|
 |
|