[fpc-pascal]filemode info for fpc docn - was w2000 file opening

Lee, John LeeJ at logica.com
Thu May 10 18:44:17 CEST 2001

thanks for this info... 

Yup filemode equals $40 fixes my win 2000 access problem to a win2000
performance log...- I was originally advised to use 0 in [devel]! 

IMO one shouldn't need to look at the source...the info below should go into
docn, under reset/rewrite + short explanation of filemode 'To open files
which may be open and used by other processes filemode can be used. THE
DEFAULT SETTING IS ??? It can be set to the following values, dependent on
the operating system...'

Don't think filemode does anything under Dos. Does filemode do anything for
unix/linux/m68k? What values are appropriate? If so can this be explained
too...TIA J

-----Original Message-----
From: Gabor DEAK JAHN [mailto:djg at tramontana.co.hu]
Sent: Thursday, May 10, 2001 03:19
To: fpc-pascal at deadlock.et.tudelft.nl
Subject: RE: [fpc-pascal]w2000 file opening - was dos approx delay fn
that releases cpu

At 5/9/01 02:30 PM, you wrote:


 > I wish I could be more help about the rest of the filemode settings for
 > Win32, but unfortunately I don't recall where I got that info from.

 From the file Win32.inc:

    fmShareCompat    = $00000000;
    fmShareExclusive = $10;
    fmShareDenyWrite = $20;
    fmShareDenyRead  = $30;
    fmShareDenyNone  = $40;

If you check out Syswin32.pp from the RTL source (procedure Do_Open), you'll
see that the single Filemode value passed on by routines like Reset or
Rewrite will not be used directly but dissected into several flags and then
fed to the appropriate Win32 routines. I didn't check if every possible
value and flag is handled by the FPC RTL or not, but you can always call the
Win32 file I/O functions directly, providing whatever flag you want. The
MSDN documentation of CreateFile has a description of all flags accepted by


Gabor DEAK JAHN -- Budapest, Hungary.
E-mail: djg at tramontana.co.hu

fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org

More information about the fpc-pascal mailing list