Overview
| Artifact ID: | 4de041e5d503d2c4c9b21189b926f1a29ec9a3a5 |
|---|---|
| Ticket: | 1586470fffffffffffffffffffffffffffffffff
[file copy] doesn't copy file contents on afs |
| User & Date: | tngd on 2006-10-29 00:38:57 |
Changes
- assignee changed to: "vincentdarley"
- cmimetype changed to: "text/plain"
- comment changed to:
Environment: Linux Gentoo Dual Processor AMD64 Tcl 8.5a6(CVS) - problem located (and solved) here Tcl 8.4.9 - system version, displays same problem In my university shell account, we use afs filesystems on our home directories. When i try to use [file copy $src $dst] and the $src file is located on the afs filesystem, the $dst file will be an empty file (size = 0). I tracked the problem to the following code located in the file tcl/unix/tclUnixFCmd.c(TclUnixCopyFile): #ifdef HAVE_ST_BLKSIZE blockSize = statBufPtr->st_blksize; #else in this case, blockSize will have the value 0, which leads to (un)expected results when reading from the source file and it treats it as EOF. Why does this happen (blockSize = 0)? I have no idea... but most likely related to the fact that the source filesystem is afs. A workaround would be to test the blockSize value when it has a nonpositive value and replace it with a default value when it happens. With this check all files were copied correctly. I noticed there is another similar situation when this also might happen; when statfs information is used on the source file i guess this behaviour might lead to similar problems, but i'm just guessing on this one. The problem was found while building/testing tcl from cvs HEAD, but the tcl installed on the system - tcl8.4.9 - was showing the same problem. - foundin changed to: "obsolete: 8.5a5"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "tngd"
- subsystem changed to: "37. File System"
- title changed to: "[file copy] doesn't copy file contents on afs"
- type changed to: "Bug"