TFileStream能以共享的方式打开文件吗?

解决方案 »

  1.   

    mfileStream :=TFileStream.Create('C:/123.txt',fmShareDenyRead);fmShareCompat Sharing is compatible with the way FCBs are opened.
    fmShareExclusive Other applications can not open the file for any reason.
    fmShareDenyWrite Other applications can open the file for reading but not for writing.
    fmShareDenyRead Other applications can open the file for writing but not for reading.
    fmShareDenyNone No attempt is made to prevent other applications from reading from or writing to the file.
      

  2.   

    The Rights parameter indicates the permission bits with which to create the file on Linux when Mode is fmCreate. Rights is ignored when used on the Windows platform.
    在WINDOWS下,这些控制权限是被乎略的,你可能需要改写TFileStream类,或重新建立一个替代文件流类。看看TFileStream类的实现就知道怎么回事了。
      

  3.   

    if Ret<>ERROR_ALREADY_EXISTS then