Solved

How to fprintf to write out to a remote file

Posted on 2004-04-02
5
330 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
Comment Utility
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
Comment Utility
0
 
LVL 9

Accepted Solution

by:
ankuratvb earned 500 total points
Comment Utility
0
 
LVL 12

Expert Comment

by:stefan73
Comment Utility
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
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
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…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

762 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now