Solved

How to fprintf to write out to a remote file

Posted on 2004-04-02
5
336 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 45

Expert Comment

by:Kdo
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

Expert Comment

by:ankuratvb
ID: 10741330
0
 
LVL 9

Accepted Solution

by:
ankuratvb earned 500 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
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.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

803 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