Home > Back-end >  File to read the I/O ERROR 32
File to read the I/O ERROR 32

Time:10-03

Application needs to read a text file for processing, the implementation code is roughly as follows:
Assignfile (f, 'test. TXT);
Reset (f);
Readln (f, s);
.

Is not used to read other application to open, or has already been notepad, word, application ultraedit open text files, everything is normal, but used to open is the securecrt software records such as log file, the I/o error 32, unless the securecrt is shut, this file can be read normal again, question should be due to the file being used, my program is not allowed to open it, and this case with application ultraedit and notepad can still open the log file, ask them is how to achieve? What is the solution?

thank you

CodePudding user response:

So try
 var 
F: TFileStream;
The begin
F:=TFileStream. Create (' test. TXT, fmOpenReadWrite or fmShareDenyNone);
end;

CodePudding user response:

Use TFileStream. Create this method also tried, the result is the same,,,

CodePudding user response:

Open the file sharing way,

CodePudding user response:

Has been opened by other program in exclusive mode, I want to open this file, please said in detail how to use a Shared model open?

CodePudding user response:

Has been resolved, using TFileStream. The Create method

CodePudding user response:

Also encounter this problem before, now know, 'thank u
  • Related