unlink path



I need to delet some files, so I thought of unlink.


http://us3.php.net/manual/en/function.unlink.php

Now, I'm confused by the path in the example:

<?php
$fh = fopen('test.html', 'a');
fwrite($fh, '<h1>Hello world!</h1>');
fclose($fh);

mkdir('testdir', 0777);

unlink('test.html');
unlink('testdir');
?>


What is that relative to, where the script is run? Or something else?

I assume I can do this:
unlink($_SERVER['DOCUMENT_ROOT']. '/path_relative_to_document_root') ?

Jeff

.



Relevant Pages

  • Re: unlink a dir??
    ... You should report that to PHP. ... because unlink() will remove a directory in most C libraries..permissions being OK.. ... rmdirIIRC merely checks that it is an empty directory. ...
    (comp.lang.php)
  • permissions problem with unlink()
    ... I am having trouble getting unlink() to work on my local machine ... (win 2000, Apache, php 4.2.2) ... I have looked at and checked the permissions on all the relevant folders via ...
    (comp.lang.php)
  • Re: unlink a dir??
    ... Basic unlink() usage: ... because unlink() will remove a directory in most C ... The PHP  manual doesn't actually say at a cursory glance  that unlink ...
    (comp.lang.php)
  • Re: Pleas Help Me (File Upload and delete)
    ... I am using Windows Xp using Xamp to run my php application ... while unlink the file i received one error like Access denied in my ...
    (comp.lang.php)
  • Re: [PHP] Patterns
    ... On 6/7/07, Steve Marquez wrote: ... If the file ends in .php, then I want it to unlink from a certain folder. ... // Do your unlinkroutine for .htm/.html files here.... ...
    (php.general)