You are here:

C/open a file that is in a shared folder

Advertisement


Question
i have mapped a shared folder in drive b and wants to open this file in c program using fopen function but it is not able to open th file if i write this way
fp =fopen("B:\\name of the file","r");
msg comes file does not exist

Answer
Check if you have given the name of the file correctly.
Also, check if it (the name you have specified) is a file or a directory?

If everything is correct it should open the file without error.

Actually, you need not share a folder, if they are all on same machine!

-ssnkumar

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Narendra

Expertise

I can answer questions in C related to programming, data structures, pointers and file manipulation. I use Solaris for doing C code and if you have questions related to C programming on Solaris, I will be able to help better.

Experience

6.5

Organizations belong to
Sun Microsystems

Awards and Honors
Brain Bench Certified Expert C programmer.
Advanced System Software Certified

©2012 About.com, a part of The New York Times Company. All rights reserved.