Artifacts Associated With Ticket 218481
Ticket change [b93703622c] (rid 129100) by nobody on 2000-10-26 01:01:05:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- 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 - foundin initialized to: "obsolete: 8.0p2"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "37. File System"
- title initialized to: "Append mode "a" does not agree with APPEND mode"
- type initialized to: "Bug"
Ticket change [9ae63e685e] (rid 111028) by welch on 2000-10-26 08:23:17:
- closedate changed to: "2000-10-26T01:23:17"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"