Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2001-05

RE: RE: filemode info for fpc docn - was w2000 file o

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Peter Vreman
I was trying to suggest a new way that is o/s independent...

The current way is o/s independent! So i don't see why a new way should be created. It'll make things only more incompatible and complex.

Show quoted text 48 lines
-----Original Message----- From: Peter Vreman Sent: Friday, May 11, 2001 01:14 To: Subject: Re: [fpc-pascal]RE: filemode info for fpc docn - was w2000 file opening > 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... Why do we need a new way? The current filemode values all support opening modes correctly. The only missing thing for easier accessing are the fm<Mode> constants in the system unit. I don't have tp here so i can't check the tp7 rtl for it. For delphi/kylix they are defined in Sysutils _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Unknown author
to Peter Vreman

To:
From: Peter Vreman
Subject: RE: [fpc-pascal]RE: filemode info for fpc docn - was w2000 file o Date sent: Fri, 11 May 2001 14:10:50 GMT
Send reply to:

Show quoted text 5 lines
> I was trying to suggest a new way that is o/s independent... The current way is o/s independent! So i don't see why a new way should be created. It'll make things only more incompatible and complex.

It isn't fully OS independent, in fact, because FileMode constants don't have the same meaning on all supported platforms. The trouble John is having is probably caused by the fact that DOS with SHARE.EXE loaded (which is simulated by all VDMs) uses sharing mode of 0 (i.e. none sharing mode specified) as the so-called "compatibility mode" with basically the same behaviour as "deny none", whereas you have to use a specific (different) sharing mode number on other targets (including Win32 and OS/2) for this. We could probably add a workaround for this to do_open, the question is, whether we want to do so (it would break compatibility with previous releases, among other things).

Tomas

Reply by email