Skip to content
Tcl Source Code History Of Ticket 218481
Login

History Of Ticket 218481

Artifacts Associated With Ticket 218481

  1. Ticket change [b93703622c] (rid 129100) by nobody on 2000-10-26 01:01:05:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 681 Bug
      Version: 8.0p2
      SubmitDate: '1998-09-23'
      LastModified: '1999-11-05'
      Severity: MED
      Status: Released
      Submitter: welch
      ChangedBy: hobbs
      OS: All
      OSVersion: NA
      Machine: NA
      FixedDate: '1999-11-05'
      FixedInVersion: 8.3b1
      ClosedDate: '2000-10-25'
      
      
      According to open(3tcl):
             a              Open  the  file for writing only.  The file
                            must already exist, and the file  is  posi=AD
                            tioned  so that new data is appended to the
                            file.
      
      The semantics of this are unclear from this documentation, but I
      contend that they should be the same as those of ANSI C "a", which are
      to position the file pointer at the end of the file prior to each
      write.
      
      Otherwise, programs which want this (correct) behaviour will all have
      to use the POSIX-derived {... APPEND ...} syntax.
      
      (This bug/misfeature also exists in my private debianisation of
      upstream 8.1a2.)
      
      Ian.
      
      -anarres:~/junk> cat t.tcl
      foreach {fn mode} {t a  u {WRONLY APPEND CREAT}} {
          puts "testing $fn with mode $mode"
          file delete -force $fn
          set f1 [open $fn $mode]
          set f2 [open $fn $mode]
          fconfigure $f1 -buffering none
          fconfigure $f2 -buffering none
          puts $f2 "data f2"
          puts $f1 "DATA WRITTEN WITH F1"
          puts $f2 "more f2"
          close $f1
          close $f2
      }
      -anarres:~/junk> rm -f t.strace; strace -ot.strace tclsh8.0 t.tcl
      testing t with mode a
      testing u with mode WRONLY APPEND CREAT
      -anarres:~/junk> cat t
      DATA WRImore f2
      H F1
      -anarres:~/junk> cat u
      data f2
      DATA WRITTEN WITH F1
      more f2
      -anarres:~/junk> dpkg -S `type -p tclsh8.0`
      tcl8.0: /usr/bin/tclsh8.0
      -anarres:~/junk> dpkg -s tcl8.0
      Package: tcl8.0
      Status: install ok installed
      Priority: optional
      Section: libs
      Installed-Size: 641
      Maintainer: David Engel <[email protected]>
      Version: 8.0p2-3
      Provides: tclsh
      Depends: libc6, libreadlineg2 (>=3D 2.1-4), ncurses3.4, tcl8.0
      Conflicts: tcl, tcl74 (<=3D 7.4p3-2)
      Description: The Tool Command Language (TCL) v8.0 - Run-Time Package.
       TCL is a powerful, easy to use, interpreted scripting language.
      
      
      The only problem here is the bug in the docs for "a", in that
      we should (and do) follow POSIX fopen, where "a" doesn't care
      whether the file exists or not.  However, there is a standard
      difference between "a" and "APPEND", in that APPEND moves to
      the end of the file on EACH write, while "a" only sets the
      INITIAL postion to the end. 
      -- 11/05/1999 hobbs
      
    4. foundin initialized to: "obsolete: 8.0p2"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "37. File System"
    10. title initialized to: "Append mode "a" does not agree with APPEND mode"
    11. type initialized to: "Bug"
  2. Ticket change [9ae63e685e] (rid 111028) by welch on 2000-10-26 08:23:17:

    1. closedate changed to: "2000-10-26T01:23:17"
    2. closer changed to: "welch"
    3. priority changed to: "2"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"