Click to See Complete Forum and Search --> : Accessing Remote Files


sachinchakote
June 20th, 2007, 02:10 AM
Does anyone have an idea about retrieving remote files from one windows machine to another.
Generally normal c++ api ( FindFirstFile , FindNextFile ) gets local files / directories or remote shared drives.. what i want is how to get files of remote unshared drives like C$ , D$ etc..


Sachin

MrViggy
June 20th, 2007, 11:38 AM
If the drive is not shared, you cannot get a listing of the drive. C$, D$, etc., are shared. These are the administrative shares, and you must have the proper security settings to access them. If you're an admin, these look like regular shared drives (you just need to know they are there).

Viggy

MikeAThon
June 20th, 2007, 01:18 PM
For unshared drives, both computers must be executing programs that use a mutually-agreed-upon protocol for exchanging this information. One common example is an FTP client and server, which will give you the information you seek.

AFAIK, there is not an API like FindXxx() that will do this.

Mike

sachinchakote
June 21st, 2007, 06:39 AM
First of all .. Thanks for your replies..

Is there any API which with Admin rights can access remote machines unshared . drives..

MrViggy
June 21st, 2007, 11:28 AM
No, like Mike said you'll need to write a server and a client app to transfer the data.

If you want to access administrative shares, I believe you'll need to setup some permissions before making your calls to the API. Unfortunately, I've never done this, so I don't know what the steps would be. Sorry.

Viggy

sachinchakote
June 22nd, 2007, 03:04 AM
HI viggy & Mike
Thanks for your help ..
me too think that its better to use client server approach for transferring data..
and there is no much help and documentation on MSDN about it.. :(

Anyways thanks a lot to both ..

one more problem which i am facing is following symbolic link ..
I am FindFirstFile, FindNextFile API to recursively get all the files in a directory.
But when i come across a link it gives info of the link and dont follow the target ..
e.g. if "c:\books.lnk" points to say "d:\my-book" then in this case the FindNextFile doesnt give info about d:\my-books

do u guys have any idea about retrieving target of a link.


Thanks in advance

Sachin

viggu
June 22nd, 2007, 06:38 PM
Hi

I am also trying to implement a client/server program using winsock. MY goal is to transfer a file from any location from my comp to a client in another comp. Is there any api which allows me to chose the source location and destination location for file transfer ?

regards
viggu

sachinchakote
June 27th, 2007, 09:04 AM
i am facing the problem and is choosing to transfer files from client machine to server's shared folder.
so in this we can use normal copyFile API