PtokaX forum

Development Section => HOW-TO's => HOW-TO requests => Topic started by: Shurlock on 28 May, 2004, 22:47:48

Title: Deleting a temp file
Post by: Shurlock on 28 May, 2004, 22:47:48
Hi all,


How can I delete a temp file that has been created and used to collect info for a specific user?

The file is created using 'writeto(file)'  and is no longer of value once sent to that user.
In fact, the user could re-request that info so the file should be deleted instantly after sending the content.

Hope this is clear.

Thanks for any help!
Title: New Topic
Post by: VidFamne on 28 May, 2004, 23:09:32
Quoteremove (filename)
Deletes the file with the given name. If this function fails, it returns nil, plus a string describing the error.
Title: New Topic
Post by: Shurlock on 28 May, 2004, 23:23:52
QuoteOriginally posted by VidFamne
Quoteremove (filename)
Deletes the file with the given name. If this function fails, it returns nil, plus a string describing the error.


VidFamne, I am almost ashamed!  :(

Never would have thought it to be that simple!
Thanks just the same for a very quick response!

I'll be using it in the script for Freeslots (by Tezlo) to eliminate the 'Annoying Sounds' the user receives with every sentence sent.  8)

Create a list in file (yes, I know, could be table as well but have no experience with tables) and send the file, delete it and ready again for action.

Greets from Holland!