View Single Post
Old 04-23-2007, 11:25 AM  
Yil
Too much time...
 
Join Date: May 2005
Posts: 1,194
Default

From tuff:

Quote:
A possible addition to ioftpds itcl command set would be welcome, let me elaborate a little

at the moment, scripters can

set windows_readable_path [resolve vfs $ioftpd_vfs_path]

but we cant reverse that

set ioftpd_vfs_path [resolve real $windows_readable_path]

at the moment, im using a dirty hack involving parsing vfs files to accomplish this/
It's actually [resolve pwd "path"] to get a real directory from a vfs path, but I was looking into providing the reverse for you and realized there isn't a function in ioFTPD to do this! Internally most everything is kept with the virtual path and once turned into a real path is never reversed...

The [resolve pwd] is itself sorta tricky since it doesn't allow for returning multiple results in the case of a merged directory. The number of cases where this is is an issue is probably small, but perhaps actually adding a [resolve vfs] command that returns a list of real directories that resolve to the vfs would be a good idea...

The [resolve real] to get a vfs will also have a similar problem. It's possible that a particular directory is mounted more than one place so perhaps I'll have to return a list as well, or just assume the first result like pwd and provide a [resolve mount] command that returns a list of them.

In order to do what you want with reverse resolving I'll have to do what you're doing except I can cheat since I already have the mount table parsed internally. So tuff, why don't you cut/paste your reverse logic and I'll use that as a basis for the itcl version just in case there is some edge case I don't see right now.

I think I remember neoxed has a similiar function in his nxtools somewhere and I'll try to dig that up as well...
Yil is offline   Reply With Quote