| |
|
|
| FileGetContentsFromTo gives bCount amount characters from Dateiinhalt ex position from as String back. CompileMarkSeparation
nProc fgcfromto(string fle,long from,bCount){
long hFile=createFile(fle,GENERIC_READ,FILE_SHARE_READ,0,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0)
case hFile==INVALID_HANDLE_VALUE : return ""
long sz=dim(16)
ifnot getFileSizeEx(hFile,sz) {
dispose(sz)
closeHandle(hFile)
return ""
}
long fz=long(sz,0)
if long(sz,4) or fz==0 or fz<=from {//0 byte or bigger than 2GB not supported
dispose(sz)
closeHandle(hFile)
return ""
}
dispose(sz)
case bCount==-1 : bCount=fz-from
long data=dim(bCount),rdC=dim(4)
setFilePointer(hFile,from,,)
readFile(hFile,data,bCount,rdC,0)
long rdd=long(rdC,0)
dispose(rdC)
closeHandle(hFile)
string s
case rdd : s=char$(data,0,rdd)
dispose(data)
return | 07/29/11 ▲ | |
|
|
|