lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I understand, someone correct me if I am wrong that on
Unix unlink will remove the file when the last user of it
closes the file. THis equals the FILEFLAG_DELETE_ON_CLOSE
on windows.

On windows remove and unlink require exclusive access.

DB

On 1/15/06, Chris Marrin <chris@marrin.com> wrote:
> D Burgess wrote:
> > I would agree with leaving exec() for another day.
> > The only addition to the list that I would add is maybe unlink().
>
> What does unlink() do that the existing os.remove() does not?
>
> Posix has both a remove() and an unlink() function. The former follows
> the clib definition, i.e., it causes "the file ... to be no longer
> accessible by that name". This is the abstract equivalent of unlink() on
> a unix system, which has stated semantics that are specific to the
> various flavors of unix file system. Seems like remove() is the better
> function for cross-platform support.
>
> --
> chris marrin              ,""$, "As a general rule,don't solve puzzles
> chris@marrin.com        b`    $  that open portals to Hell" ,,.
>          ,.`           ,b`    ,`                            , 1$'
>       ,|`             mP    ,`                              :$$'     ,mm
>     ,b"              b"   ,`            ,mm      m$$    ,m         ,`P$$
>    m$`             ,b`  .` ,mm        ,'|$P   ,|"1$`  ,b$P       ,`  :$1
>   b$`             ,$: :,`` |$$      ,`   $$` ,|` ,$$,,`"$$     .`    :$|
> b$|            _m$`,:`    :$1   ,`     ,$Pm|`    `    :$$,..;"'     |$:
> P$b,      _;b$$b$1"       |$$ ,`      ,$$"             ``'          $$
>   ```"```'"    `"`         `""`        ""`                          ,P`
>