Overview
| Artifact ID: | 5d426133ccda68311d310f01680f1f59940e0b0f |
|---|---|
| Ticket: | 218524ffffffffffffffffffffffffffffffffff
every 4096th char is changed to a carriage return |
| User & Date: | nobody on 2000-10-26 01:01:40 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
OriginalBugID: 887 Bug Version: 8.1a2 SubmitDate: '1998-12-02' LastModified: '1999-11-04' Severity: CRIT Status: Released Submitter: admin ChangedBy: hershey OS: All OSVersion: NA Machine: NA FixedDate: '1999-11-04' FixedInVersion: 8.1b1 ClosedDate: '2000-10-25' I have discovered the following problem in both tcl8.1a2 and the net distribution of tcl8.1. Basically, if you write out more than 4096 bytes of data that has carriage returns in it to a channel which has been fconfigured to have translation crlf, it will change every 4096th character to a carriage return. Syd Polk The following script illustrates the problem: # Test 1 - Case that works set bigstring {} for {set i 0} {$i < 10000} {incr i} { append bigstring "0" } set f [open foo.out w] fconfigure $f -translation crlf puts $f $bigstring nonewline close $f set f [open foo.out] fconfigure $f -translation crlf set readstring [read $f] close $f catch {file delete -force foo.out} if {[string compare $bigstring $readstring] != 0} { puts "Test 1 did not work" } # Test 2 - Fails set bigstring {} for {set i 0} {$i < 10000} {incr i} { append bigstring "000000000\n" } set f [open foo.out w] fconfigure $f -translation crlf puts $f $bigstring nonewline close $f set f [open foo.out] fconfigure $f -translation crlf set readstring [read $f] close $f catch {file delete -force foo.out} if {[string compare $bigstring $readstring] != 0} { puts "Test 2 did not work" } Fixed... -- 11/04/1999 hershey - foundin changed to: "obsolete: 8.1a2"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "57. zlib"
- title changed to: "every 4096th char is changed to a carriage return"
- type changed to: "Bug"