* fix FileSetAttr - bug #28826

git-svn-id: trunk@32019 -
This commit is contained in:
Tomas Hajny 2015-10-11 18:30:29 +00:00
parent ace95e550b
commit ebd1c6026c

View File

@ -422,10 +422,15 @@ Var
Begin
SystemFileName:=ToSingleByteFileSystemEncodedFileName(Filename);
New(FS);
FillChar(FS, SizeOf(FS^), 0);
FS^.AttrFile:=Attr;
RC := DosSetPathInfo(PChar (SystemFileName), ilStandard, FS, SizeOf(FS^), 0);
if RC <> 0 then
RC := DosQueryPathInfo (PChar (SystemFileName), ilStandard, FS, SizeOf (FS^));
if RC = 0 then
begin
FS^.AttrFile:=Attr;
RC := DosSetPathInfo(PChar (SystemFileName), ilStandard, FS, SizeOf(FS^), 0);
if RC <> 0 then
OSErrorWatch (RC);
end
else
OSErrorWatch (RC);
Result := - longint (RC);
Dispose(FS);