Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 01-01-2006, 10:22 AM   #1
qw12er
Confirmed User
 
Join Date: Apr 2004
Location: Montreal
Posts: 799
:stoned Unix Guru - need your help

How can I set file to expire by themself ?

I'm creating files in PHP for download but once it has been downloaded I what the file to be destroyed. How can I do that ?

Can I put an expiration date like time() + 3600; so the serveur would destroy the file an hour after creation ?

Thanks a lot and
Happy new year !
__________________
I have nothing to advertise ... yet.
qw12er is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-01-2006, 11:28 AM   #2
etech
Confirmed User
 
Join Date: Feb 2004
Location: Right next to you....
Posts: 1,148
add a timestamp to the filename, and when you are creating a new file, see if there are any files that are older than n minutes. if so, delete it.
etech is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-01-2006, 11:40 AM   #3
hive
Worker Bee
 
Join Date: Apr 2003
Posts: 90
crontab this hourly

find /path/files/are/in/ -type f -mmin +60 -print


replace the -print with -delete AFTER YOU HAVE VERIFIED it finds the right files to delete.
hive is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-01-2006, 11:53 AM   #4
qw12er
Confirmed User
 
Join Date: Apr 2004
Location: Montreal
Posts: 799
thank you guys.


Do you know if the tmpfile function in PHP use the memory to create the file or does it write it on the HD ? This could fix my problem...
__________________
I have nothing to advertise ... yet.
qw12er is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.