#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Location
    Bombay, India
    Posts
    159
    Rep Power
    12

    Whats this os.unlink?


    Could anyone enlighten me on os.unlink()?
    I'm not getting anything that explains abt it...

    Thanks,
    Subha
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Location
    Houston, TX
    Posts
    383
    Rep Power
    13
    From http://www.python.org/doc/current/lib/os-file-dir.html -
    unlink(path)
    Remove the file path. This is the same function as remove(); the unlink() name is its traditional Unix name. Availability: Macintosh, Unix, Windows.
    And os.remove:
    remove(path)
    Remove the file path. If path is a directory, OSError is raised; see rmdir() below to remove a directory. This is identical to the unlink() function documented below. On Windows, attempting to remove a file that is in use causes an exception to be raised; on Unix, the directory entry is removed but the storage allocated to the file is not made available until the original file is no longer in use. Availability: Macintosh, Unix, Windows.
    Debian - because life's too short for worrying.
    Best. (Python.) IRC bot. ever.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Location
    Bombay, India
    Posts
    159
    Rep Power
    12
    Yes thanks Strike. But I'd been to that place..but didn't get a clear answer!

    What does "Remove the file path." really mean?


    Subha
  6. #4
  7. slightly insane code guru
    Devshed Novice (500 - 999 posts)

    Join Date
    Jul 2004
    Location
    Indianapolis, IN
    Posts
    871
    Rep Power
    17
    unlink = delete. os.unlink deletes the file specified by a certain path.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Location
    Bombay, India
    Posts
    159
    Rep Power
    12
    got it!

IMN logo majestic logo threadwatch logo seochat tools logo