|
2007-12-14
| ||
| 09:34 | • Closed ticket [1830450fff]: open file treats a+ as a (append) plus 7 other c... artifact: a8f990e122 user: hobbs | |
|
2007-11-12
| ||
| 21:28 | • Add attachment tclopenbug.tcl to ticket [1830450fff] artifact: 9eaf2169a5 user: legolas_a20 | |
| 21:28 | • Ticket [1830450fff] open file treats a+ as a (append) status still Open with... artifact: f4c0a66122 user: legolas_a20 | |
| 14:28 | • New ticket [1830450fff]. artifact: 1e962ea4b4 user: legolas_a20 | |
open file treats a+ as a (append)
Closed / Duplicate1830450fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 19 years ago
Descriptionplain2007-11-12 14:28:36
when opening a file, specifying "a+" as mode acts just like "a" when it comes to setting the file pointer before a puts, after a seek. Both act like "a", which, as the docs say: "Set the file pointer to the end of the file prior to each write." "A+" should, according to the docs "Set the initial access position to the end of the file." so if I open f with a+, and then do: seek $f 5 puts -nonewline $f "qqq" the qqq should end up at file position 5. It ends up at file position 'end' instead. See the attachment for a script that reproduces this, and a workaround: using RDWR as mode works as "a+" should work. The script writes a file called test.bin, and then attempts to update the middle of it as described above (and fails to do that on my 8.4.16 on windows xp sp2), followed by doing the same thing with the workaround, on a file named test2.bin (and that does work).
legolas_a20plain2007-11-12 21:28:36
File Added - 253930: tclopenbug.tcl
hobbsplain2007-12-14 09:34:53
Logged In: YES user_id=72656 Originator: NO Fixed in 8.4.17, dup of 1773127 that just didn't get backported.
Log in (anonymous is fine) to add a comment.
Attachments:
- tclopenbug.tcl [download] added by legolas_a20 on 2007-11-12 21:28:36. [details]