Ticket UUID: | 886352 | |||
Title: | file copy -force fails when cross filesystem copy | |||
Type: | Bug | Version: | None | |
Submitter: | nobody | Created on: | 2004-01-28 17:43:18 | |
Subsystem: | 37. File System | Assigned To: | vincentdarley | |
Priority: | 5 Medium | Severity: | ||
Status: | Closed | Last Modified: | 2004-01-29 19:26:20 | |
Resolution: | Fixed | Closed By: | vincentdarley | |
Closed on: | 2004-01-29 12:26:20 | |||
Description: |
f1 is a regular file f2 is a regular file with read-only permissions file copy -force $f1 $f2 Works if f1 and f2 are in a regular filesystem but fails if f2 is in a different filesystem (e.g. inside a tclkit) Andreas Kupries suggests this may be related to a flaw in crossfilesystem copy function http://www.equi4.com/pipermail/starkit/2004- January/001814.html And Vicent Darley finds out exactly where http://www.equi4.com/pipermail/starkit/2004- January/001821.html The following test cases ilustrates the problem. The first one pases the second one does not. You need to execute it using tclkit test.tcl -verbose ve package require tcltest package require mk4vfs proc writeFile {dest text} { set f [open $dest w] puts -nonewline $f $text close $f } proc readFile {dest} { set f [open $dest r] set r [::read $f] close $f return $r } tcltest::test copy1 {Copy file no permissions} {} { foreach f {f1 f2} { set $f [file join $::tcltest::testsDirectory $f] file delete -force $f writeFile $f $f } file attributes $f2 -permissions 0000 file copy -force $f1 $f2 set result [readFile $f2] file delete -force $f1 $f2 set result } {f1} # For some reason, if both files in disk no problem, if origin in tclkit, it fails tcltest::test copy2 {Copy file from tclkit to disk no permissions} {} { set kitFile [file join $::tcltest::testsDirectory test.kit] ::vfs::mk4::Mount $kitFile $kitFile set t $::tcltest::testsDirectory set f2 [file join $t f2] file delete -force $f2 writeFile $f2 f2 set f1 [file join $kitFile f1] writeFile $f1 f1 file attributes $f2 -permissions 0000 file copy -force $f1 $f2 ::vfs::unmount $kitFile set result } {f1} | |||
User Comments: |
nobody added on 2004-01-29 19:21:20:
Logged In: NO Yes, it does indeed work now. Thanks! (patch took care automatically of CRLF issues too) vincentdarley added on 2004-01-29 01:13:45: File Added - 75018: permfix.patch Logged In: YES user_id=32170 Attached is a patch to fix this and another issue. Please test (note: on unix the eol's in the patch must be converted first). |
Attachments:
- permfix.patch [download] added by vincentdarley on 2004-01-29 01:13:45. [details]