Sujet : File ops on a VFS mounted file De : scotty (at) *nospam* svptechnicalservices.com.au (Scott Pitcher) Groupes :comp.lang.tcl Date : 21. Apr 2025, 02:42:02 Autres entêtes Organisation : SVP TECHNICAL SERVICES Message-ID :<20250421114119.79ff1721@officepc> User-Agent : Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu)
Hi, I've got some executables built with kbskit on Windows and Linux, and I'm trying to get one of them to copy itself to another file, as part of initialising a new VFS for an end user application. The VFS was created with vlerq by kbs.tcl. When the exetuable VFS attempts to copy itself to the target image (opts(1) == the target file name) -
failed to create target VFS "...": can't overwrite file "..." with directory
- because of course the VFS is also mounted and my script is running inside of that.
I tried using [open ...] and [puts ... [read ..]] but the VFS image file can't be opened while it's mounted.
I was able to successfully use [exec cp......], but external tools probably won't be available on the end user systems and certainly not on MS Windows.
But if the VFS is mounted then it's already been opened by the VFS library itself. Perhaps there is a way of duplicating the file handle or accessing the naked VFS image file without invoking the VFS library?