Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 593df38ad67876865df34362699bc8a8e4359eb8
Ticket: 634151ffffffffffffffffffffffffffffffffff
[file mtime f time] don't work correctly
User & Date: vincentdarley on 2002-11-07 05:34:34
Changes

  1. assignee changed to: "hobbs"
  2. icomment:
    Logged In: YES 
    user_id=32170
    
    Please see these lines in tclIOUtil.c:
    
    /* 
     * utime wants a normalized, NOT native path.  I assume a native
     * version of 'utime' doesn't exist (at least under that
    name) on NT/2000.
     * If a native function does exist somewhere, then we could use:
     * 
     *   return native_utime(Tcl_FSGetNativePath(pathPtr),tval);
     *   
     * This seems rather strange when compared with stat, lstat,
    access, etc.
     * all of which want a native path.
     */
    static int 
    NativeUtime(pathPtr, tval)
        Tcl_Obj *pathPtr;
        struct utimbuf *tval;
    {
    #ifdef MAC_TCL
        long gmt_offset=TclpGetGMTOffset();
        struct utimbuf local_tval;
        local_tval.actime=tval->actime+gmt_offset;
        local_tval.modtime=tval->modtime+gmt_offset;
        return
    utime(Tcl_GetString(Tcl_FSGetNormalizedPath(NULL,pathPtr)),
     &local_tval);
    #else
        return
    utime(Tcl_GetString(Tcl_FSGetNormalizedPath(NULL,pathPtr)),tval);
    #endif
    }
    
    it appears as if on linux there is a native utime, and so
    the code needs changing.  I'm assigning this to Jeff since
    the basic code which didn't use native paths was, I think,
    written by him.
    
    I really don't know what platforms/OSes want native paths
    here.  The same bug will be in all preceding Tcl versions
    which support 'file mtime $f $time', I believe.
    
    
    
    
  3. login: "vincentdarley"
  4. mimetype: "text/plain"
  5. username: "vincentdarley"