View Single Post
Old 10-05-2009, 09:28 PM  
Yil
Too much time...
 
Join Date: May 2005
Posts: 1,194
Default

dr.owned: Interesting. First comment I'd make is that most of the problems you appear to be having are caused by trying to fake out pure virtual files/dirs instead of letting the server know they are links to real items. MTDM, RETR w/RESTORE, etc all would work correctly if you weren't trying to hide the link from the server because it's outputting in a way that some web clients don't like. If I fix that with the ":" option for you all that should become cleaner while still outputting as you like. For the moment try using links and see how much of a difference that makes and let me know what still doesn't work right. Also, see if there is a difference between dir and file handling in practice.

Having said that you bring up an interesting point with renaming. If the original directory is a real directory then once you realize that the script should return a resolved link to it. I'm not sure what the target should do however. That's a pretty special case but just returning an error probably works since the item shouldn't exist anyway. It gets even weirder if you try to rename purely virtual items since even if I pass the current command in as an option that wouldn't give you enough data to completely understand what is going on. I can however pass as an extra argument the stored source name if I have one. Renaming is already handled as one of a very few special case multiple command sequences with the other being downloading/uploading. I'm not convinced yet that with using resolved links and by letting the server know about existing items that normal file up/down won't work correctly without all that extra stuff.

The resolver when running does have a couple of flags that might be interesting to pass to the script. The most important are the EXIST and DIRECTORY flags which indicate the item must actually exist (i.e. downloading needs to actually find a file, or the dir must be already created, etc) and/or that the target must be a directory and not a file. I can certainly arrange to have those passed along if it would make a difference but right now it just looks at the results of the script and applies the flags to that.
Yil is offline   Reply With Quote