Re: Snapscan ... again

From: Frederik Ramm (sane@mail.remote.org)
Date: Sat May 12 2001 - 09:38:49 PDT

  • Next message: Henning Meier-Geinitz: "Re: Xsane - winsane? was Re: saned won't run under inetd"

    Hi,

    regis rampnoux <regisr@pobox.com> wrote:
    > I don't understand also why in this function a temporary file is
    > created and unlinked but closed later... and some write can may be
    > happen!

    This is a standard operating procedure at least with Unix. It is
    perfectly legal to "unlink" an open file; this will remove the
    directory entry but to all intents and purposes the file is still
    there for all those who have openend it before the "unlink" happened.
    Only when no process has the file opened will it cease to exist.

    By creating the temp file and unlinking it immediately after, you make
    sure that the file won't stick around if your process dies.

    Bye
    Frederik

    -- 
    Frederik Ramm  ##  eMail frederik@remote.org  ##  N57°48.10' W005°40.32'
    

    -- Source code, list archive, and docs: http://www.mostang.com/sane/ To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com



    This archive was generated by hypermail 2b29 : Sat May 12 2001 - 09:35:16 PDT