mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-29 20:00:19 +02:00
* don't perform fmShareDenyNone/fmShareExclusive check for unix, as it
cannot be implemented there git-svn-id: trunk@12674 -
This commit is contained in:
parent
8a0c16edb6
commit
adaae268ae
@ -141,12 +141,18 @@ begin
|
|||||||
if (l2 < 0) then
|
if (l2 < 0) then
|
||||||
raise exception.create('opening two files as read-only with fmShareDenyNone and then fmShareDenyWrite failed');
|
raise exception.create('opening two files as read-only with fmShareDenyNone and then fmShareDenyWrite failed');
|
||||||
fileclose(l2);
|
fileclose(l2);
|
||||||
|
{ on Windows, fmShareExclusive checks whether the file is already open in any way by the current
|
||||||
|
or another process. On Unix, that is not the case, and we also cannot check against a
|
||||||
|
fmShareDenyNone mode
|
||||||
|
}
|
||||||
|
{$ifndef unix}
|
||||||
l2:=fileopen('tfile2.dat',fmopenread or fmShareExclusive);
|
l2:=fileopen('tfile2.dat',fmopenread or fmShareExclusive);
|
||||||
if (l2 >= 0) then
|
if (l2 >= 0) then
|
||||||
begin
|
begin
|
||||||
fileclose(l2);
|
fileclose(l2);
|
||||||
raise exception.create('opening two files as read-only with fmShareDenyNone and then fmShareExclusive succeeded');
|
raise exception.create('opening two files as read-only with fmShareDenyNone and then fmShareExclusive succeeded');
|
||||||
end;
|
end;
|
||||||
|
{$endif}
|
||||||
fileclose(l);
|
fileclose(l);
|
||||||
|
|
||||||
l:=fileopen('tfile2.dat',fmopenread or fmShareDenyWrite);
|
l:=fileopen('tfile2.dat',fmopenread or fmShareDenyWrite);
|
||||||
|
Loading…
Reference in New Issue
Block a user