|
-
Apr 29th, 2001, 12:19 PM
#1
Thread Starter
Junior Member
Creating a temporary file in Perl
I want to --
1) take information from a form on a web page -- OK I can do that
2) use it in a Perl script -- OK I can do that
3) create a file from the Perl script -- OK I think I can do that
4) create a web page with a link to the file so a user can download
it -- OK I can do that
4) have the file automatically deleted after say 1 hour --
AH, NOW I'M STUCK !!!
Would appreciate if anyone can help with this
Peter Brown
-
Apr 30th, 2001, 06:53 AM
#2
Lively Member
Well if you could avoid using a temporary file then it is fine... however if it is a need then well the only real way is to either a) leave the script running constantly looping for 1 hour (not reccomended) or b) See if your server offers CRON, CRON is a basic service similar to taskmanager on windows, basicly you place an entry in a file and at the time you want something to run it will run a script (or it can run non-stop) ... what you can do is place all your temporary files in one directory and when the hour passes have the directory wiped... or you could place a timestamp on the files so that the script can decide wether it is time to delete the file or not. Simple but only if they offer this service....
otherwise just dont use temporary files and havethe person constanly recreate the page... Any Questions?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|