Unable to copy xxxx: The file is being used by another person or program, in this case how to use QT copy this file, or read out the contents of the file
The file is being used by another person or program, in this case how to use Delphi to copy this file, or directly read the contents of the file?
procedureTform1.button1click (sender:tobject);varF:thandle; Abuffer:Array[0..1024x768] ofbyte; C:integer;beginF:= FileOpen ('C:\Users\kk\Documents\Fichiers outlook\mon fichier de données Outlook (1). pst', FmopenreadorFmsharedenynone); Fillchar (Abuffer, SizeOf (abuffer),0); if(f<>0) and(f<> Invalid_handle_value) Then beginC:=System.SysUtils.FileRead (F, Abuffer, SizeOf (Abuffer)); ifC=sizeof (Abuffer) ThenShowMessage ('OK') ElseShowMessage ('fail') End;End;
Shenzhen JOE was mostly looking for a handle, so he could handle it.
Handle of a file that wants to read all the content easily open
Internal is called CreateFile ZwCreateFile Open file just find the corresponding open file handle just fine
Refer to Special methods:
http://blog.csdn.net/mydo/article/details/3266703
Test open File and read file contents