CyRius Posted February 13, 2010 Share Posted February 13, 2010 (edited) I have this code, but FileRead() returns nothing after the page 20+ (or 30+).I think the problem is with the FileSetPos().Helpfile says for FileSetPos():Parameters:handle - A handle to a file previously opened with FileOpen().If i use as FileSetPos(0,$iBufSize * $iPage + 1,$FILE_CURRENT) just works fine. Tell me what is the problem:)$sFileLoc = @ScriptDir & '\Downloads\Movie.avi' $iBufSize = 1024 * 1024 ;=1MB $iMaxPage = Round(FileGetSize($sFileLoc) / $iBufSize) $hFile = FileOpen($sFileLoc,16) For $iPage = 0 To $iMaxPage FileSetPos($hFile,$iBufSize * $iPage + 1,$FILE_CURRENT) $iBuffer = FileRead($hFile,$iBufSize) ConsoleWrite($iPage & '/' & Round(FileGetSize($sFileLoc) / $iBufSize) & ' ' & BinaryLen($iBuffer) & @CRLF) Next FileClose($hFile)Greetz, CyRius Edited February 13, 2010 by CyRius [font="Courier New"][size="3"]CyRius Developments[/size][/font][list][*]CO Proxy[*]CO Assembly tool[*]CO PacketSniffer[*]Larkinor proxy[*]BoIM Messenger[*]Encrypt/Decrypt[*]Hashtables[*]Slowest, but greatest skins ever xD[/list] Link to comment Share on other sites More sharing options...
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!Register a new account
Already have an account? Sign in here.Sign In Now