Re: Preventing file sharing



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!
.



Relevant Pages

  • Re: Folder Options - File Types - Restore
    ... The date and time was Tuesday, May 12, 2009 8:45:37 AM, and on a whim, BillW50 pounded out on the keyboard: ... Word2000 instead of Notepad, ... Readme.txt, it opens just fine. ...
    (microsoft.public.windowsxp.general)
  • Re: Notepad conversion
    ... I've never heard of Arabe Notepad. ... Please respond in the newsgroups so everyone can follow along. ... I was sent a document that opens in Notepad. ...
    (microsoft.public.word.conversions)
  • Re: Folder Options - File Types - Restore
    ... BillW50 pounded out on the keyboard: ... Word2000 instead of Notepad, ... Readme.txt, it opens just fine. ... to edit and modify the file type (Application used to perform ...
    (microsoft.public.windowsxp.general)
  • Re: Dont have permission after re-enabling guest account?
    ... Paste into Notepad. ... When Notepad opens up displaying c:\cdiag.txt, ... Do this from both computers, please, with both computers powered up and online. ... Start CDiag Assembled Code ...
    (microsoft.public.windowsxp.network_web)
  • File Associations Bug - Please Help!
    ... file.doc opens with Word and file.mpg opens ... Windows has somehow managed to disassociate ... return to the list and notepad is nowhere to be found. ... SP2, so I don't think that's the cause. ...
    (microsoft.public.windowsxp.general)

Loading