Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

exclusive file open at windows and linux

421 views
Skip to first unread message

Leonard

unread,
Jan 5, 2001, 4:19:52 AM1/5/01
to
Hi,
I'm writing a client/server console program for win2k server. This program
have to exclusive open/read/write to a share file on a linux machine.
I'm using _fsopen("\\\\linux\sharefile", "at", _SH_DENYWR).
When i run multiple copies of my program on 1 win2k machine, it does achive
the exclusive open/read/write.
But when i run multiple copies of my program from different win2k machine,
it failed !

Anybody know how to do that ? I need to run the same program at different
win2k machine.

My situation :
MachineA (win2k) -> run myprogram.exe
MachineB (win2k) -> run myprogram.exe
MachineC(linux, fileserver). -> shareFile1.txt

both myprogram.exe may open shareFile1.txt at MachineC at the same time. And
i need to prevent this.
Only 1 guy can access(open/read/write) shareFile1.txt at the same time.

Anybody know how to solve it ?

Thank you very much.

Regards,
Leornard.


Felix Kasza [MVP]

unread,
Jan 6, 2001, 12:22:54 PM1/6/01
to
Leonard,

> I'm using _fsopen("\\\\linux\sharefile", "at", _SH_DENYWR).

_SH_DENYWR only denies writes. The other thing I would check is, if the
file resides on an NT box, does the sharing work (well, _not_ work) as
you expect?

--

Cheers,
Felix.

If you post a reply, kindly refrain from emailing it, too.
Please consider migrating to microsoft.public.platformsdk.*
where the MS folks plan on hanging around. See you there!

0 new messages