From: SourceForge.net <no...@so...> - 2006-10-29 00:38:57
|
Bugs item #1586470, was opened at 2006-10-29 01:38 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1586470&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 36. File System Group: current: 8.5a5 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Tiago Dionizio (tngd) Assigned to: Vince Darley (vincentdarley) Summary: [file copy] doesn't copy file contents on afs Initial Comment: 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. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1586470&group_id=10894 |