Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Detecting files in a virtual file system ?

51 views
Skip to first unread message

Aldo Buratti

unread,
Jul 17, 2017, 10:06:42 AM7/17/17
to

How can I detect if a given pathname refers to a file on the native-OS filesystem, or in a vfs virtual filesystem ?

I premise that I read the documentation about [file system ....] but it does not state exactly what should be returned ( ... it might be "vfs ftp" .... ).
I found that it also might return "tclvfs" ... but of course this is not a rule.

Any suggestions ?

ABU

Mike Griffiths

unread,
Jul 17, 2017, 4:56:22 PM7/17/17
to
I think the reason it doesn't state exactly is that extensions may add additional capabilities with additional values for this. But it's a one or two element list, and you can probably assume that

if { [lindex [file system $file] 0] ne "native" } {
# vfs
}

is accurate enough for most purposes.

blacksqr

unread,
Jul 17, 2017, 5:08:03 PM7/17/17
to
From the Tclvfs manual page:


vfs::filesystem info ?path?

If no arguments are given, this returns a list of all filesystems mounted (in all interpreters). If a path argument is given, then the command to be used for that path is returned, or an error is thrown if no vfs is mounted for that path.

Aldo Buratti

unread,
Jul 18, 2017, 10:03:17 AM7/18/17
to
It's OK for my purpose. Thanks !
0 new messages