Overview
| Artifact ID: | 29334e4414b1ad4153a5c6b0fdd2fb6f18adee6c |
|---|---|
| Ticket: | 680143ffffffffffffffffffffffffffffffffff
Multi-append file surprise |
| User & Date: | dkf on 2003-02-04 11:52:30 |
Changes
- assignee changed to: "andreas_kupries"
- cmimetype changed to: "text/plain"
- comment changed to:
There is a difference between the following two scripts: #!/usr/local/bin/tclsh8.4 foreach i { 0 1 2 3 4 5 6 7 8 9 } { puts [open "/tmp/test.out2" "a"] $i } and #!/usr/local/bin/tclsh8.4 foreach i { 0 1 2 3 4 5 6 7 8 9 } { puts [open "/tmp/test.out2" {WRONLY CREAT APPEND}] $i } In the first case, only a single value ("0") appears in the file once the script has run, but in the second case, all values written to the file appear in it. This difference in behaviour between the "a" mode and the given set of options is highly surprising to me, and a problem since many pieces of code that add information to log files may well be using it assuming that the latter behaviour will happen. This could lead to information loss when several processes append to the same log file, which is very serious and fairly tricky to reproduce reliably. Should the behaviour of "a" (and possibly "a+"?) be altered so as to use the APPEND flag internally, instead of a single seek when the file is opened (which must be what happens at the moment.) - foundin changed to: "obsolete: 8.4.1"
- priority changed to: "9 Immediate"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "dkf"
- subsystem changed to: "24. Channel Commands"
- title changed to: "Multi-append file surprise"
- type changed to: "Bug"