Can PHP delete files from server? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Can PHP delete files from server?

SnookerLoopySnookerLoopy Posts: 41Member
Hi,

The application I am writing currently creates a certain number of text files whose use eventually expires. Rather than clogging up the server with this files, is there a simple command to delete them?

Understandably, most PHP textbooks don't go into great detail about deleting files from servers (because of likely misuse) but I don't see any other way round this problem. Thanks :-)

Comments

  • Eraser9486Eraser9486 Posts: 32Member
    Yes, it can be done using the "unlink" function.. the manual page can be found at the following URL: http://us3.php.net/manual/en/function.unlink.php

    : Hi,
    :
    : The application I am writing currently creates a certain number of text files whose use eventually expires. Rather than clogging up the server with this files, is there a simple command to delete them?
    :
    : Understandably, most PHP textbooks don't go into great detail about deleting files from servers (because of likely misuse) but I don't see any other way round this problem. Thanks :-)
    :
  • SnookerLoopySnookerLoopy Posts: 41Member
    Thanks mate, much appreciated!

    : Yes, it can be done using the "unlink" function.. the manual page can be found at the following URL: http://us3.php.net/manual/en/function.unlink.php
    :
    : : Hi,
    : :
    : : The application I am writing currently creates a certain number of text files whose use eventually expires. Rather than clogging up the server with this files, is there a simple command to delete them?
    : :
    : : Understandably, most PHP textbooks don't go into great detail about deleting files from servers (because of likely misuse) but I don't see any other way round this problem. Thanks :-)
    : :
    :

  • Micky01Micky01 Posts: 34Member
    I guess you have a soulution already, but here's another tutorial.. on the unlink function:
    http://www.tizag.com/phpT/filedelete.php
    I found it helpful.



    : Thanks mate, much appreciated!
    :
  • SnookerLoopySnookerLoopy Posts: 41Member
    Thanks man, that was also useful :-)

    : I guess you have a soulution already, but here's another tutorial.. on the unlink function:
    : http://www.tizag.com/phpT/filedelete.php
    : I found it helpful.
    :
    :
    :
    : : Thanks mate, much appreciated!
    : :
    :

  • derekKinnyderekKinny Posts: 1Member
    www.tooLongPath.com saved me lot of time for solving this
Sign In or Register to comment.