|
2004-09-15
| ||
| 08:50 | • Ticket [1027690fff] read $channel file size "myfile" doesn't wor... artifact: f6bb8f5afb user: wobster | |
|
2004-09-14
| ||
| 23:30 | • Closed ticket [1027690fff]. artifact: 8927cff475 user: dgp | |
| 23:28 | • Ticket [1027690fff]: 6 changes artifact: aebbbb28cc user: dgp | |
| 23:28 | • Add attachment 1027690.patch to ticket [1027690fff] artifact: 1bf2f990c5 user: dgp | |
| 23:04 | • Ticket [1027690fff] read $channel file size "myfile" doesn't wor... artifact: 7b2a4310b7 user: dgp | |
| 22:51 | • Ticket [1027690fff]: 4 changes artifact: 1b6acdbc76 user: dgp | |
| 22:35 | • Ticket [1027690fff]: 4 changes artifact: 12c46ae49b user: dgp | |
| 17:43 | • Ticket [1027690fff]: 4 changes artifact: 7bc473235d user: wobster | |
| 15:21 | • Ticket [1027690fff]: 7 changes artifact: d2523c1111 user: dkf | |
| 15:07 | • Ticket [1027690fff]: 4 changes artifact: 1de5752c18 user: dkf | |
| 11:58 | • Ticket [1027690fff]: 1 change artifact: 7fb2bc87bc user: wobster | |
| 04:58 | • New ticket [1027690fff]. artifact: 3c5be37c7e user: wobster | |
read $channel [file size "myfile"] doesn't work in 8.4 head
Closed / Fixed1027690fffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 22 years ago
Descriptionplain2004-09-14 04:58:01
I just checked out the head of the 8.4 branch. It appears that there is a bug related to the "read" command when executing this test case: set f [open "myfile" r] set contents [read $f [file size "myfile"]] nothing is read. But, if you do this: set bytes [file size "myfile] set contents [read $f $bytes] it works fine. This worked in earlier versions of 8.4. p.s. please delete previous bug report. I wasn't logged in when I submitted the bug.
wobster Ticket [1027690fff]: 1 change
[History diff]2004-09-14 11:58:42
dkfplain2004-09-14 15:07:56
Logged In: YES user_id=79902 As a workaround, try just doing this: set contents [read $f] as that's been tuned to work fast in all releases of 8.4.
dkfplain2004-09-14 15:21:56
Logged In: YES user_id=79902 Can't tell if this is a fault with [file size] (when it belongs to category 36) or [read] (which I've assigned it to for now.) What is the size of that file BTW, or does that not matter?
wobsterplain2004-09-14 17:43:46
Logged In: YES user_id=60261 Thanks for the tip. It appears that the problem is OS-specific. It doesn't work on Solaris and Irix, but does on Linux. Actually, it looks like it's a problem with read. I tried this test as well: % pwd /tmp/bak/tcl8.4.7/unix % set f [open "Makefile" r] file6 % puts [file size "Makefile"] 50346 % read $f [file size "Makefile"] % read $f $size ; # nothing printed % read $f 50346 # Generated automatically from Makefile.in by configure. ... For some reason, this works as well: read $f [expr [file size "Makefile"] - 1] The file size is actually 50346 by the way according to "ls -l" and "wc -c".
dgpplain2004-09-14 22:35:11
Logged In: YES user_id=80530 confirmed on Solaris 9. Bug *not* present in the Tcl 8.5 development branch.
dgpplain2004-09-14 22:51:43
Logged In: YES user_id=80530 Can the original submitter confirm this is a new bug, present in the 8.4 development branch, but not in the Tcl 8.4.7 release ?
dgpplain2004-09-14 23:04:03
Logged In: YES user_id=80530 Appears the patch for bug 868489 introduced this. Thanks for the testing to discover this quickly!
dgpplain2004-09-14 23:28:32
File Added - 101481: 1027690.patch Logged In: YES user_id=80530 Here's the fix.
dgpplain2004-09-14 23:30:48
Logged In: YES user_id=80530 fix committed.
wobsterplain2004-09-15 08:50:26
Logged In: YES user_id=60261 Thanks for the lightning fast fix! That must be a record. Now, we can confidently migrate to 8.4.7+ without changing our sources. :-)
Log in (anonymous is fine) to add a comment.
Attachments:
- 1027690.patch [download] added by dgp on 2004-09-14 23:28:32. [details]