SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Temporary file

  1. #1
    SitePoint Member
    Join Date
    Dec 2005
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Temporary file

    Hello!

    I want generate a file (.txt), but just for 1 hour (is an example), is that possible?

    Thanks

  2. #2
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I think that the only way of doing that is to call a function every time a page on your server is loaded. This function would look for all files in the directory and delete (using unlink()) those which are over an hour old.

    I think that's the closest you can get to automation.
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  3. #3
    SitePoint Zealot detzX's Avatar
    Join Date
    Oct 2006
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cron
    Have it run every 5 minutes and check for files that have expired. Delete them if they have.
    www.invoicejournal.com - Invoice clients for Free


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •