For Programmers: Free Programming Magazines  


Home > Archive > Tcl > October 2006 > Help regarding vfs









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Help regarding vfs
Alan Folsom

2006-10-24, 8:03 am

I am running into a problem with VFS that has me
stymied.

If I run the following script on Mac OS X 10.4
(Tcl release 8.4.10) using a PowerPC mac.
The script is unable to read it's own vfs. Copies
to the mounted vfs succeed (I can unwrap them and
see the files) But the script is not able to read
the vfs it itself created. Unix permissions all
seen normal.

If I try to directly open a preexistent vfs I get
the same problem, it can find no files in it, even
though the file exists and was created by a previous
execution of the same script.

---
package require vfs::mk4
console show

vfs::mk4::Mount lib.vfs /tmp

foreach fl [glob -nocomplain P*.*] {
puts stdout "copying $fl to \/tmp\/[file tail $fl]"
file copy -force $fl /tmp/[file tail $fl]

}
foreach fl [glob /tmp/*.*] {
puts stdout "found $fl"
}

vfs::filesystem unmount /tmp

::vfs::mk4::Mount lib.vfs /tmp
puts stdout "remounting"
foreach fl [glob /tmp/*.*] {
puts stdout "found $fl"
}
vfs::filesystem unmount /tm
---
The log file shows the copies, but crashes on the
second glob, having found no files. If I take the first
two loops out and just try to open and glob a preexistent
lib.vfs, I get the same crash.

Any suggestions on what may be going wrong here?

Thanks,

Al
--
--------------------------------------------------
Alan L. Folsom, Jr. alan@folsoms.net
--------------------------------------------------
Alan Folsom

2006-10-30, 7:32 pm

Not to answer my own question, but it appears the problem was related to
using /tmp as the mount point for the vfs.

the file copy chose the vfs mount over the 'real' /tmp. The glob chose
the 'real' one before considering the vfs. Weird that there should be
a difference between the two, but que sera, sera.

ALF

Alan Folsom wrote:
> I am running into a problem with VFS that has me
> stymied.
>
> If I run the following script on Mac OS X 10.4
> (Tcl release 8.4.10) using a PowerPC mac.
> The script is unable to read it's own vfs. Copies
> to the mounted vfs succeed (I can unwrap them and
> see the files) But the script is not able to read
> the vfs it itself created. Unix permissions all
> seen normal.
>
> If I try to directly open a preexistent vfs I get
> the same problem, it can find no files in it, even
> though the file exists and was created by a previous
> execution of the same script.
>
> ---
> package require vfs::mk4
> console show
>
> vfs::mk4::Mount lib.vfs /tmp
>
> foreach fl [glob -nocomplain P*.*] {
> puts stdout "copying $fl to \/tmp\/[file tail $fl]"
> file copy -force $fl /tmp/[file tail $fl]
>
> }
> foreach fl [glob /tmp/*.*] {
> puts stdout "found $fl"
> }
>
> vfs::filesystem unmount /tmp
>
> ::vfs::mk4::Mount lib.vfs /tmp
> puts stdout "remounting"
> foreach fl [glob /tmp/*.*] {
> puts stdout "found $fl"
> }
> vfs::filesystem unmount /tm
> ---
> The log file shows the copies, but crashes on the
> second glob, having found no files. If I take the first
> two loops out and just try to open and glob a preexistent
> lib.vfs, I get the same crash.
>
> Any suggestions on what may be going wrong here?
>
> Thanks,
>
> Al

blacksqr

2006-10-30, 7:32 pm

I think that if the glob command preferred the "real" /tmp over the
virtual mount, that should be considered a bug.

What happens if instead of [glob /tmp/*.*] you try [glob -directory
/tmp *.*] ?


Alan Folsom wrote:[color=darkred]
> Not to answer my own question, but it appears the problem was related to
> using /tmp as the mount point for the vfs.
>
> the file copy chose the vfs mount over the 'real' /tmp. The glob chose
> the 'real' one before considering the vfs. Weird that there should be
> a difference between the two, but que sera, sera.
>
> ALF
>
> Alan Folsom wrote:

Alan Folsom

2006-10-31, 7:07 pm

That still finds the "real" /tmp rather than the mounted file system.

Weird.

Al

blacksqr wrote:
> I think that if the glob command preferred the "real" /tmp over the
> virtual mount, that should be considered a bug.
>
> What happens if instead of [glob /tmp/*.*] you try [glob -directory
> /tmp *.*] ?
>
>
> Alan Folsom wrote:
>
>
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com