Könnte sein, dass das in aktuelen Versionen von XProfan schon gefixt ist.
Bei mir (XProfan9) wird beim Aufruf von FileSize immer ein Handle auf den Ordner nicht wieder geschlossen, in dem sich die Datei befindet:
Code
Def NtQueryInformationProcess(5) !"NTDLL","NtQueryInformationProcess"
Declare File$, Edit&, Button&, Dir$, H_Count&, Read&
Windowstyle 31
WindowTitle "FileSize Test"
Window 0,0-640,440
Button&=Create("Button",%HWND,"Testen",20,20,500,30)
Repeat
Waitinput
IF Clicked(Button&)
CLS
NtQueryInformationProcess(External("KERNEL32.dll","GetCurrentProcess"),20,ADDR(H_Count&),4,ADDR(Read&))
Locate 10,0
Print "Offene Kernelhandles vor dem Listing: "+Str$(H_Count&)
ClearList
Dir$=$SYSPATH
File$=FindFirst$(Dir$+"\"+"*.*")
While File$<>""
Locate 20,0
Print Dir$+"\"+File$+Space$(255)
IF (FileExists(Dir$+"\"+File$)=1) or (DirExists(Dir$+"\"+File$)=1)
Assign #1,Dir$+"\"+File$
IF DirExists(Dir$+"\"+File$)=1
Addstring File$+" "+GetFDate$(#1)+" "+GetFTime$(#1)
elseif (FileExists(Dir$+"\"+File$)=1)
CHDIR Dir$
Addstring File$+" "+GetFDate$(#1)+" "+GetFTime$(#1)+" "+Str$(FileSize(Dir$+"\"+File$))
endif
endif
NtQueryInformationProcess(External("KERNEL32.dll","GetCurrentProcess"),20,ADDR(H_Count&),4,ADDR(Read&))
Locate 11,0
Print "Offene Kernelhandles: "+Str$(H_Count&)+" "
File$=FindNext$()
EndWhile
NtQueryInformationProcess(External("KERNEL32.dll","GetCurrentProcess"),20,ADDR(H_Count&),4,ADDR(Read&))
Locate 11,0
Print "Offene Kernelhandles nach dem Listing: "+Str$(H_Count&)+" "
Editbox("Dateien in "+Dir$,1)
endif
until 0
Alles anzeigen