File I/O on Network drive, Quick Question

This is a discussion on File I/O on Network drive, Quick Question within the C++ Programming forums, part of the General Programming Boards category; Hi, I'm having a problem calling a network drive as a computer name for file I/O. It works ok if ...

1. File I/O on Network drive, Quick Question

Hi,

I'm having a problem calling a network drive as a computer name for file I/O.

It works ok if I specify a drive letter with the path - eg. ofstream fp("g:\\dir1\\dir2\\stuff.txt", ios::app);

But not working if i do this: ofstream fp("tdrscr123:\\dir1\\dir2\\stuff.txt", ios::app);

Any ideas? anything will be helpful.

Thanks!

2. I thought it was
\\machine\path\to\file.txt

Which when written in code would be

Code:
ofstream fp("\\\\machine\\path\\to\\file.txt", ios::app);

3. Thanks, i'll let you know how it goes.

4. Works great. Thanks.

Popular pages Recent additions