Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact


Moderators: larsivi kris

Posted: 11/20/07 13:33:06

Hello, I have created a wrapper around the FTP and HTTP client classes making them indifferent in use with my class called download. I was wondering would this be useful for Tango VFS. If it is I will rewrite it so as to get rid of the need for Progress bars(personal need so as I can update them in Dinstaller). If you like you could view the code first then decide. I am more than willing to make changes to it to help it become part of tango. If there is something I'm missing here would you please let me know. Do I have to make it like the other VFS things you have or do I just leave it as is if you do want it. If I don't want to go through the trouble to making it like the other vfs things could you still use it. Answer those questions to yourself and consider please. I kind of don't know much about vfs so I may be barking up the wrong tree so to speak. Later on, unless you get there first, I will be making a libarchived wrapper that wraps someone elses libarchive for d and gives it a class like interface for dealing with zip files. Maybe that would be useful for you too. Any questions, suggestions, and etc I would like to see at this forum because I don't check others very often.

Thanks for your consideration, Lester L. Martin II

Lester L. Martin II

Author Message

Posted: 11/20/07 14:09:29

A FTP VFS implementation for Tango would have to implement the various interfaces in, such that it can act as any other folder. If you are willing to do that, we would be very interested in looking at it for inclusion :)

As for zip file support, that is already being worked on, and the Tango VFS will gain a ZipFolder? fairly soon.

Posted: 11/20/07 15:33:47

Ok in spare time I'll work on an FTP VFS folder for tango.

Thankyou, Lester L. Martin II

Lester L. Martin II

Posted: 11/20/07 18:19:48 -- Modified: 11/20/07 20:54:41 by

Exactly what is needed to make a class like vfs. I mean what do my classes need to inheret and what functions am I required to implement. Am I allowed to add auxillary functions and am I allowed to make those functions functionality wrap that which is provided by previously defined functions. I know less about vfs than I thought and am slowly leeching it. I've never encountered a need to use a non existent folder by making a virtual one, loading it in memory, then saving it back to the drive. I've always done file system operations directly on the file system with the most virtual thing being when it is to be flushed into the actuall file system. I will learn this fairly new concept!

Lester L. Martin II

Posted: 11/20/07 21:04:19

Is it ok to call my implementation WebFolder? since I will make it able to use FTP and HTTP protocols interchangebly. I think it would be bad to call it FtpFolder? and it includes HTTP to unless it is wanted that those implementations be seperated.

Um also since it cannot tell the difference between ftp and http by finding in the string "ftp" or "http" is it bad practice to make it try{ connect http;}catch(Exception e){connect ftp;}. Pseudocode above came in no specific order and will be likely implemented to try ftp first if ftp is detected in the connection string and same with http to "try" to "optimize" it from always having a performance hit.

I did decide that some auxillary functions is a bad idea as I already have a lot to deal with. Maybe I'll make this my Dinstaller coproject and work on both as I find time as my time is very limited "thank the Lord for Thanksgiving to give me time" on most days.

Well any suggestions and such would be gladly accepted.

Lester L. Martin II

Lester L. Martin II

Posted: 11/21/07 05:17:08 -- Modified: 11/21/07 05:17:46 by


You can implement it any way you like, as long as it implements all the functionality inside (the various interfaces). I'd suggest splitting HTTP apart from FTP, so the user can choose explicitly?

There's wiki page for the VFS over here that explains how it works. Basically, your HttpFolder and/or FtpFolder would probably accept a root URI (or equivalent) and all subsequent operations would be based upon relative paths from that point forward. Once the object is created, the user would not even know there was FTP or HTTP involved, other than latency :)

We build the drivers in this manner so that you can easily mount multiple different drivers (File, Zip, Ftp, Http, WebDAV, etc) into a common virtual root, and then treat the whole thing as a single file system.

Hope that help :)

Posted: 11/21/07 07:47:39

Ok, Http and FTP will be divided. Does everyone think when I say http I'm talking of WebDav??

Lester L. Martin II

Lester L. Martin II

Posted: 11/21/07 10:18:56

apparently :)

Posted: 11/21/07 10:31:09

Ok does the HttpClient? classes implement WebDav? Capabilities. If not then I can't do it just now as ftp and http would be easier and less time consuming. I've been looking all morning for source code in C, C++, or C# that shows how someone has implemented a web protocol and none of them look like something I want to do anytime soon. That was from looking at an ftp library implemented in C# because the other's were not found easily or not found at all.

Lester L. Martin II

Posted: 11/21/07 10:38:15

You can see the other thread, but no, the current HttpClient don't support WebDav?. Which is why I think you should focus on FTP for now :)

Posted: 11/21/07 10:53:19

Oops, Larsivi I didn't even know you had posted there. I look at the reply number to judge should I go back in and I guess I remembered the reply number as 3 before it became 3 and never noticed it had changed. Ok now I'm going to work on ftp and ftp only for a while. (I'll remember to check for replies even if the number didn't change now since I see how well the number thing worked out).

Thank you Kris and Larsivi for your help,

Lester L. Martin II

Posted: 11/21/07 10:58:23

Um the Ftp Client webpage has disappeared according to my computer and now displays a 404 error.

Lester L. Martin II

Posted: 11/21/07 11:11:14

You are right about the 404 - you can still look at the source though :)