SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: unlink to delete folder?

  1. #1
    SitePoint Zealot
    Join Date
    Nov 2007
    Posts
    102
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    unlink to delete folder?

    Hm, i have this intresting things going on. I red somewhere that you can't delete non-empty folder with rmdir, but i somehow manages to delete whole none-empty folder with simple unlink(folder), but this is on my localhost.

    So my question is, is this how unlink works? Can you delete non-empty subfolder with unlink?

  2. #2
    SitePoint Enthusiast
    Join Date
    May 2004
    Location
    Western Europe
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Unlink removes files, not folders. http://en.php.net/manual/en/function.unlink.php
    unlink('folder') failed on my computer with the following error:
    ---------- Run ----------

    Warning: unlink(c:\!): Permission denied in C:\1.php on line 1
    PHP Warning: unlink(c:\!): Permission denied in C:\1.php on line 1

    Output completed (0 sec consumed)

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
  •