[fpc-pascal]RE: filemode info for fpc docn - was w2000 file opening
Lee, John
LeeJ at logica.com
Fri May 11 12:59:38 CEST 2001
It'd be best if we could have something that's o/s independent... but I
accept, based on the comments, that this might be difficult (see my 0.001
euro worth below). Until we can do this tho' my main reason for raising this
is to simply document what the choices are for each o/s...& I guess that
isn't too difficult.
Maybe instead of trying to adapt things we could just have a normal open (0
as at present) and a 'try to open whatever eg whether file locked or not'
value eg as another variable say called, say, force_open, (eg 1) which are
same value for all o/s & wouldtherefore be portable...Eg for win32 this
could translate to the current filemode vals of 0 and $40, for linux
whatever. If users want more sophisticated behaviour we'd tell users to use
the appropriate o/s dependent filemode values directly...
From: Michael.VanCanneyt at Wisa.be
Sent: Friday, May 11, 2001 01:24
To: core at freepascal.org
Subject: Re: filemode info for fpc docn - was w2000 file opening
On Thu, 10 May 2001, Marco van de Voort wrote:
> > On Thu, 10 May 2001, Marco van de Voort wrote:
> >
> > > > > 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.
> > > >
> > > > It does something under all platforms, just the values it accepts
are
> > > > different under each platform.
> > > >
> > > > I've added this to my todo list, though.
> > >
> > > Do you intend to solve it via a series of constants, or conversion of
the
> > > value in the functions that use FileMode?
> > >
> >
> > I don't intend to do anything in the RTL, I plan to mention it in the
docs
> > :)
> >
> > Do you think this should be treated on a RTL level ? Even Kylix doesn't
> > do that. (simply not possible, I think)
>
> Why not ? We can introduce fmxxx like constants for filemode variable too
on
> a per platform basis?
yes, but what are these constants and what if some constant has no meaning
on some platform ? fmShareDenyNone or something has no meaning on Linux.
> It won't be perfect, but it will make keeping targets source compatible
with
> eachother easier.
I know; I haven't really decided for myself what it's going to be.
Michael.
More information about the fpc-pascal
mailing list