![]() ![]() ![]() The fmShareDenyRead specifies that the file can by write but not read by other processes. The fmShareDenyWrite specifies that the file can by read but not write by other processes. The fmShareExclusive specifies that the file cannot be read or write by other processes. We can see that the fmOpenReadWrite is not as the same as fmOpenRead or fmOpenWrite. įmShareCompat = $0000 platform // DOS compatibility mode is not portableįmShareDenyRead = $0030 platform // write-only not supported on all platforms The File Open modes are defined in SysUtils.pas as below. However, since the file is opened only in write mode ( fmOpenWrite), if you try to add fs.ReadBuffer(v, SizeOf(v)) you will have an exception ‘ Stream Read Error‘ raised. program Test įs := TFileStream.Create('C:\test.txt', fmOpenWrite) ![]() Below is a sample usage that appends a ‘A’ to a file everytime. In Delphi, the TFileStream can be used to stream the file reading and writing. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |