[Starkit] "suspend" vfs
Jean-Claude Wippler
jcw at equi4.com
Fri Sep 30 15:01:36 CEST 2005
David Welton wrote:
> Just thought I'd send this in in case it's of use to anyone else.
>
> I needed to make a copy of the starpack that I'm using, and of course
> when it's mounted, that is problematic. I came up with the following
> code:
>
> proc suspendvfs {code} {
> set me [info nameofexe]
> lassign [vfs::filesystem info $me] drv dbh
> vfs::filesystem unmount $me
> # Unmounted, now run the code
> uplevel $code
> # Remount it
> vfs::filesystem mount $me [list vfs::mk4::handler $dbh]
> }
>
> which I then use like so:
>
> suspendvfs { file copy -force $source $dest }
>
> Good idea? Flawed in some way?
Yep! Only if uplevel throws an error - not sure a remount would
matter much, though.
The name is nice, but it does not make it clear that the exe's vfs is
suspended, not any other starkit.
Would it be an idea to add a proc like this to starkit.tcl in the
tclvfs package?
-jcw
More information about the Starkit
mailing list