Opening files on a server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mrlem313
    New Member
    • Sep 2007
    • 1

    #1

    Opening files on a server

    Is it possible to open a file using C++ that resides on a server?

    e.g.

    #include <iostream>
    #include <iomanip>
    #include <fstream>
    using namespace std;

    int main() {
    int sum = 0;
    int x;
    ifstream inFile;

    inFile.open("ht tp:\\123.321.12 3.321\Files\tes t.txt");

    ...
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    Originally posted by mrlem313
    Is it possible to open a file using C++ that resides on a server?

    e.g.

    #include <iostream>
    #include <iomanip>
    #include <fstream>
    using namespace std;

    int main() {
    int sum = 0;
    int x;
    ifstream inFile;

    inFile.open("ht tp:\\123.321.12 3.321\Files\tes t.txt");

    ...
    Not that quickly or easily, I'm afraid. You will need two programs - a client and a server. The client will sit on the machine the file resides on, and will open a connection to the server machine. This is done through socket programming, and is what you want to research.

    Comment

    Working...