[Starkit] Error when copying files from startkit to disk (with test cases)

Guaca Mole guacamole1234 at yahoo.com
Mon Jan 26 14:21:27 CET 2004


I have a problem extracting files from starkit if the
destination file exists and is not writable.

file copy -force f1 f2

works when f2 is not writable but f1 and f2 are in the
regular filesystem.
It fails when f2 is not writable and f1 is inside a
tclkit. f2 is in the filsystem

My current workaround is to change the permissions of
f2 before copying. Is this a bug? Am I doing something
wrong?


tcltest::test copy1 {Copy file no permissions} {} {
    foreach f {f1 f2} {	
	set $f [file join $::tcltest::testsDirectory $f]
	file delete -force $f
	maui::file::write $f $f
    }
    file attributes $f2 -permissions 0000
    maui::file::copy $f1 $f2
    set result [maui::file::read $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
    maui::file::write $f2 f2
    set f1 [file join $kitFile f1]
    maui::file::write $f1 f1    
    file attributes $f2 -permissions 0000
    maui::file::copy $f1 $f2
    ::vfs::unmount $kitFile
    set result
} {f1} 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/


More information about the Starkit mailing list