Following statement runs fine under Delphi XE (Windows 7 x64) but gives "Exception class EFOpenError with message..." under Delphi XE3 (Windows 7 x64). It looks like a bug. If so, is there a workaround?
TFileStream.Create(
'C:\Test.txt'
, fmOpenRead,
// FILE_SHARE_READ);
// FILE_SHARE_WRITE);
FILE_SHARE_READ or FILE_SHARE_WRITE);
Use
fmShareDenyNone
constant instead ofFILE_SHARE_READ or FILE_SHARE_WRITE
:it is not a bug. See Documentation for details.