?
Solved

How to fprintf to write out to a remote file

Posted on 2004-04-02
5
Medium Priority
?
346 Views
Last Modified: 2010-04-15
Being the novice, infrequent programmer that I am, I am trying to use the fprintf command to write data out to a file.  Simple enough.  In fact, I have done it on several occasions but this time there is a twist that my simple mind can't figure out.  I want to write out to a file location on another PC.  How can I do this?
0
Comment
Question by:fgs3124
5 Comments
 
LVL 46

Expert Comment

by:Kent Olsen
ID: 10741216
Hi fgs3124,

There are a couple of ways to do this, but both PCs have to cooperate for this to happen.

You can mount a drive on the remote PC using the Windows' "shared folders", unix's NFS mount, or Samba.  Then open the file on the shared drive and write to it.

You can also create a client/server application that "sends" the file from your system to the partner program on the other PC.


The bottom line is, it's a network environment and requires a network solution.


Kent
0
 
LVL 9

Accepted Solution

by:
ankuratvb earned 1500 total points
ID: 10741430
0
 
LVL 12

Expert Comment

by:stefan73
ID: 10741528
Hi fgs3124,
You can open/create a file residing on a share on another PC using the

\\machine\share\directory\...

syntax. Or use slashes instead of backslashes, should work, too.

Cheers,
Stefan
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 10741556
Hi fgs3124,

Kent is right ... you need permissions on the remote machine ....
Another way ... Maybe you can write the file locally and then invoke an ftp session to transfer the file ...

may be you can run a server on the remote machine that accepts the data and writes to the file locally ... it all depends on what kind of access you have on remote machine and what kind of setup you have

Sunnycoder
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question