TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: BALOG PAL
from: JERRY COFFIN
date: 1997-09-10 00:40:00
subject: volatile objects?

On (07 Sep 97) Balog Pal wrote to Jerry Coffin...
 BP> Hi, Jerry Coffin!
Hello,
 JC> That shouldn't be a problem.  If one process attempts to use
 JC> MoveFileEx (or MoveFile) on a file while another process has the
 JC> file open, the attempt at moving the file will fail.
 BP> But I fear the opposite situation. I move files to a directory that is
 BP> polled for files that appears there. I use MoveFileEx with
 BP> COPY_ALLOWED as they may be on another volume.
It should be easy to force this: when you open the file, specify no
sharing.  As long as the other process has the file open to copy to it,
you won't be able to open it with sharing not allowed.
 BP> That I'm not really sure. The simple rename/move is atomical. But if
 BP> the system use copy and delete it may not be, at least I found no dox
 BP> on that.
You're probably correct in that.
 JC> or (better yet) ReadDirectoryChangesW to take care of things even
 JC> more simply.
 BP> Hm, this I could not find in help of VC 4.0.  I will check it in 5.0
 BP> too, but I have to reboot to NT 4 to do that. :(
If memory serves, it's a bit newer than VC 4.0 - I believe it was added
as of NT 4.0.  It's documented in VC 4.2, and should be in 5.0 as well,
though I don't presently have that installed to check.
 JC> It's not entirely clear what you're doing, but from the sound
 JC> of things ReadDirectoryChangesW might be your best bet if you can
 JC> limit your program to NT.
 BP> Hm, that's not likely, most of those proggies I must time-to time port
 BP> to Solaris. We have a real messy system with mozaic of nearly a dozen
 BP> proggies that pass messages to each other wia DDE, files, X.400 mail,
 BP> TCP/IP, and some of them are on a Sun, some on NT.
I meant primarily as opposed to Lose95 - obviously it would require some
changes to run on Solaris, but if memory serves there should be
something vaguely analogous there as well, though I don't remember the
name.  (Then again, I haven't done anything on Solaris in over a year,
so my memory may well be wrong...)
    Later,
    Jerry.
--- PPoint 1.90
---------------
* Origin: Point Pointedly Pointless (1:128/166.5)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.