open shared folder

B

bigbinc

Is it possible to open a shared folder, for example
\\xyz\ljfdskj\ksjdl

Note: none of the examples below work?

/*
FILE *f = fopen("\\Devpmt2\\Berlin\\aceTest1.txt", "w");
fprintf(f, "This is a test from ACE");
fclose(f);
*/

//int handle= _open("\\devpmt2\\berlin\\testing1.txt", O_BINARY |
O_WRONLY | O_TRUNC | O_CREAT, 0600);
int handle = _open("O:\\acetesting1.txt", O_BINARY | O_WRONLY |
O_TRUNC | O_CREAT, 0600);

cout << handle << " The handle" << endl;
 
B

Ben Pfaff

Is it possible to open a shared folder, for example
\\xyz\ljfdskj\ksjdl

It will depend on your OS. If you want to know about OS-specific
details of your C implementation, you should ask in a newsgroup
that talks about that OS or its C implementation.
/*
FILE *f = fopen("\\Devpmt2\\Berlin\\aceTest1.txt", "w");

You need to double backslashes in quoted strings,
e.g. \\xyz\ljfdskj\ksjdl becomes "\\\\xyz\\ljfdskj\\ksjdl".
//int handle= _open("\\devpmt2\\berlin\\testing1.txt", O_BINARY |
O_WRONLY | O_TRUNC | O_CREAT, 0600);

_open is not part of the standard C library.
cout << handle << " The handle" << endl;

This is C++, not C.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,077
Messages
2,570,566
Members
47,202
Latest member
misc.

Latest Threads

Top