[fpc-pascal] Does the system unit allow file locking/sharing?

Lars noreply at z505.com
Mon Jan 16 23:04:32 CET 2017


On Mon, January 16, 2017 2:34 pm, I previously wrote:
> The oldschool way of opening files using the system unit (no sysutils)
> has the filemode variable..
>
> system.FileMode := fmOpenRead; ...
> Assign(...
> Rewrite(...
>
>
>
> Can this be used with file locking/sharing OR-ed options like:
> fmShareCompat fmShareDenyNone fmShareDenyRead fmShareDenyWrite
> fmShareExclusive
>
> Or does file locking/sharing require using sysutils unit with fileopen:
> http://www.freepascal.org/docs-html/rtl/sysutils/fileopen.html
>

To answer my own question... Looking into the fpc rtl sources I found that
DoFileLocking is inside sysutils, so likely system unit (old school
handling of files) cannot be used with locking at this stage.





More information about the fpc-pascal mailing list