How to go directly to a directory on remote server - WeOnlyDo Discussion board

How to go directly to a directory on remote server (wodSFTP / wodSFTP.NET / wodSFTPdll)

by Lars Ørjan, Thursday, October 25, 2007, 02:26 (6240 days ago)

I have trouble to list directory size on my account on remote machine.
I know how to get the size of a file, but not how to get the size of the whole directory.
I might think that I could list all the directory on the server, and then specify a directory to open, and so on list the size of the files inside.

Any idea to help?

The clue is that Iam making a tool to list all the size of directory on a server to see what size each customer have used. If they have used more than 500mb, then I could send them an invoice. [:happy:]

Thanks!

Re: How to go directly to a directory on remote se

by woddrazen, Thursday, October 25, 2007, 07:29 (6240 days ago) @ Lars Ørjan

Hi Lars,


Yes, you approach to get size of folder is good.

Unfortunately there is no nice way to read folder size from server with any client because server don't provide that infomation.

You can find here how folder size code should look like:
http://www.weonlydo.com/index.asp?forum=1&action=view&topic=1192108833

Hope I helped.


Regards,
Drazen

Re: How to go directly to a directory on remote se

by Lars Ørjan, Thursday, October 25, 2007, 10:17 (6240 days ago) @ woddrazen

Thanks.

But is there a way to go directly to a directory on the server?
When I logon I get access to all directories, but I want my application to go directly to one spesific directory.

Re: How to go directly to a directory on remote se

by woddrazen, Thursday, October 25, 2007, 10:50 (6240 days ago) @ Lars Ørjan

Lars,


You should use ListDir Method and specify which remote path you want to list.

[code]
dlx1.ListDir /home/something/your folder
[/code]

In ListDir Method you should always use full absolute path for remote path.

More help for ListDir Method you can find here:
http://www.weonlydo.com/FtpDLX/Help/wodFtpDLXLib~wodFtpDLX~ListDir.html


Drazen