Sign in to follow this  
KulSeran

Open a network file?

Recommended Posts

How would you implement the ability to open something like "\\196.168.0.2\myshare\myfile.dat"? Is there a portable way to do this? because fopen doesn't seem to work, nor does fstream. OR, do I have to resort to using some library to get that functionality portably.

Share this post


Link to post
Share on other sites
You'd first have to download the file, if you don't want to keep it permanently, save it to a temporary directory, and then open it. And no if it's something like HTTP your accessing (that is, accessing a file through HTTP) it wont edit the file and change it on the server, instead, you'd have to upload it somehow (most likely FTP), it's different for every protocol actually.

Share this post


Link to post
Share on other sites
Ah. Should have been more clear about it. A normal file dialog can access anything on the LAN. But how do you actually open the file once you get back the LAN adress to the file?
I'm sure SMP is technically a different protocal, but for most stuff in windows it seems transparent enough, and Im looking to add that functionality to my program.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by KulSeran
What would be the equivelent to CreateFile on Linux for this same purpose?


Well, if it's mounted as a Samba mount, any of the regular functions whould work. Actually, I don't see a reason why fopen or iostreams would fail on Windows...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this