Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 919e3a133502e3e803ccbfee8d49a60a5fe34f8c
Ticket: 2935503fffffffffffffffffffffffffffffffff
Incorrect mode field returned by file stat command
User & Date: apnadkarni on 2010-01-20 09:25:12
Changes

  1. assignee changed to: "vincentdarley"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    From c.l.t  posting by keithv -
    ----
    Is the mode value from file stat meaningful on Windows.
    Under tcl 8.5, it always seems to return 0644
    even if you have permission write to the file.
    
    (This problem came up when I was trying to figure
    out why tcllib's ftpd package wouldn't let me delete
    a file.)
    
    Thanks,
    Keith 
    ----
    
    Looking at the code, the problem is in the NativeStatMode function in tclWinFile.c
    The lines propagating the owner bits to group and others -
        mode |= (mode & 0x0700) >> 3;
        mode |= (mode & 0x0700) >> 6;
    should be
        mode |= (mode & 0700) >> 3;
        mode |= (mode & 0700) >> 6;
    
    (i.e. octal 700, not hex)
    
    /Ashok
    
  4. foundin changed to: "None"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "apnadkarni"
  10. subsystem changed to: "37. File System"
  11. title changed to: "Incorrect mode field returned by file stat command"
  12. type changed to: "Bug"