Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 2ca9d47aed76da8abaac9fff9c7c05e82bffd392
Ticket: 1852572fffffffffffffffffffffffffffffffff
file writable broken
User & Date: bgriffin on 2009-02-16 01:21:42
Changes

  1. icomment:
    Yes, opening and writing to the file is ok, but it's not quite that simple.  The application needs to know the access rights, long before there is any need to actually write to the file, in order to determine how to treat the file.  Think about using vi or emacs on a read-only file.  In our particular case, the file is more like a database and we need to warn the user that updates to the db will not be possible during the session.  But this is just one use model.  In another situation we display a file list along with access rights (like ls -l).  The list can be hundreds of files.  Opening each of these for write just to check write access is an unreasonable expectation.
    
    For now, we do open the file as an access check.  In all the years operating with Tcl prior to the introduction of patch 1344540 we never experienced any race issues.  Other, non-tcl, parts of our application rely on access() only with great success.  Doing so puts the onus on MS Windows crt to deal correctly with acl's.
    
    
  2. login: "bgriffin"
  3. mimetype: "text/plain"
  4. username: "bgriffin"