Re: Preventing file sharing
- From: "johnharwood@xxxxxxxxxx" <johnharwood@xxxxxxxxxx>
- Date: Mon, 7 Apr 2008 02:02:06 -0700 (PDT)
On Apr 7, 8:00 am, David Thompson <dave.thomps...@xxxxxxxxxxx> wrote:
On Mon, 24 Mar 2008 05:20:29 -0700 (PDT), "johnharw...@xxxxxxxxxx"
<johnharw...@xxxxxxxxxx> wrote:
Although I suspect that this may be a Windows question, maybe somebody
has been here before!
Using IVF and Windows XP Professional, if a file is opened with the
specifier NOSHARED and then I attempt to open it again with, say
Notepad, access is denied. Great. However, if a file is already
opened with Notepad, it is successfully opened again by my program.
notepad doesn't actually have the file open. At startup or Open, it
opens the file and 'slurps' it into memory and closes it. From then on
you work only on the memory copy, unless and until you do Save [As],
or Exit or New or Open after changes and answer the dialog to save.
To see an error you'll have to run your Fortran program while notepad
is reading, which normally takes only milliseconds, unless the file is
_really_ big (typically gigabytes) or on a remote share over say a
very busy and noisy network or a dialup VPN or somesuch.
wordpad same. Word and Excel DO keep open the file they are working
on, and Word should be able to deal with any content that notepad can
(although it typically won't be the default app for plain text files).
How do I prevent this from happening? The various INQUIRE options
return Opened=false, Share=unknown, Access=undefined
- formerly david.thompson1 || achar(64) || worldnet.att.net
Thanks, David. Steve Lionel had already pointed out to me how Notepad
operates but his reply was not posted here.
What I was trying to do is ensure that, within a small department
(half a dozen people), if somebody were using a file nobody else could
open that file.
The file locking works fine with Fortran applications, Excel and Word.
Visual Studio (which also "slurps it into memory") is not an issue for
other users. I conclude that there is no way that I can prevent the
(very remote) possibility that someone has opened the file with
Notepad, then somebody else opens it with my application, amends and
saves it, then the Notepad user closes and saves the file thereby
overwriting the now amended version of that file.
In the big picture it doesn't really matter because, the next time
that file is used, a checksum error would be detected by my
application. I just wanted to ensure that that sort of aggravation
doesn't occur!
.
- Follow-Ups:
- Re: Preventing file sharing
- From: glen herrmannsfeldt
- Re: Preventing file sharing
- References:
- Re: Preventing file sharing
- From: David Thompson
- Re: Preventing file sharing
- Prev by Date: Re: UPdate all Dependencies(CVF)
- Next by Date: Re: FoX - an XML toolkit for Fortran
- Previous by thread: Re: Preventing file sharing
- Next by thread: Re: Preventing file sharing
- Index(es):
Relevant Pages
|
Loading