Open a network file?

Started by
5 comments, last by KulSeran 18 years ago
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.
Advertisement
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.
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.
Use CreateFile to open the network file.
.
What would be the equivelent to CreateFile on Linux for this same purpose?
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...
Thanks for the info, for now i got it working in windows.

This topic is closed to new replies.

Advertisement