[Starkit] "suspend" vfs
David Welton
davidnwelton at gmail.com
Fri Sep 30 16:29:13 CEST 2005
> Yep! Only if uplevel throws an error - not sure a remount would
> matter much, though.
No, you're right, it ought to handle that.
> The name is nice, but it does not make it clear that the exe's vfs is
> suspended, not any other starkit.
I don't have a better one handy...
> Would it be an idea to add a proc like this to starkit.tcl in the
> tclvfs package?
... and go ahead if you like it. I saw similar questions on the
mailing list while researching this, so I suspect I'm not the first or
only one who wanted to do something to the starpack itself. Copying
it is the most likely operation, but perhaps there are other things
you might want to do.
Ciao,
--
David N. Welton
- http://www.dedasys.com/davidw/
Apache, Linux, Tcl Consulting
- http://www.dedasys.com/
proc suspendvfs {code} {
set me [info nameofexe]
lassign [vfs::filesystem info $me] drv dbh
vfs::filesystem unmount $me
# Unmounted, now run the code
set reterr 0
if { [catch {uplevel $code} err] } {
set reterr 1
}
# Remount it
vfs::filesystem mount $me [list vfs::mk4::handler $dbh]
if {$reterr} {error $err}
}
More information about the Starkit
mailing list