Hi SKAN,
Since I didn't find a post where you posted the File16IO.ahk directly, I'll post here. I used your FileReadEx function quite a lot. But it has one drawback: It can't read from the end of a file with an offset. So I modified it a little.
Code:
FileReadEx2( F,ByRef V,B,O=0 ) { ;B= Number of bytes, O = Offset, when negative from EOF
by:= (O<0 ? B+1 : B), VarSetCapacity(V,By,0), H:=DllCall("_lopen",Str,F,UInt,0)
IfLess,H,1, Return,-1
DllCall( "_llseek",UInt,H,UInt,O, UInt,(O < 0 ? 2 : 0) )
Return DllCall("_lread",UInt,H,Str,V,UInt,by) ( DllCall("_lclose",UInt,H)+n )
}
The only drawback is now, that in case 128 bytes from EOF should be read, it will be this
Code:
FileReadEx2( File,Var,128,-128 )
Ciao
toralf