CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2007
    Posts
    21

    Accessing Remote Files

    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

  2. #2
    Join Date
    Feb 2002
    Posts
    4,640

    Re: Accessing Remote Files

    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

  3. #3
    Join Date
    Nov 2002
    Location
    California
    Posts
    4,556

    Re: Accessing Remote Files

    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

  4. #4
    Join Date
    Jun 2007
    Posts
    21

    Re: Accessing Remote Files

    First of all .. Thanks for your replies..

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

  5. #5
    Join Date
    Feb 2002
    Posts
    4,640

    Re: Accessing Remote Files

    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

  6. #6
    Join Date
    Jun 2007
    Posts
    21

    Re: Accessing Remote Files

    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

  7. #7
    Join Date
    Jun 2007
    Posts
    8

    Re: Accessing Remote Files

    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

  8. #8
    Join Date
    Jun 2007
    Posts
    21

    Re: Accessing Remote Files

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured