Sign in to follow this  
Followers 0
scon

I want to cut a small piece of a large binary file

4 posts in this topic

Hi! Please, help

I want to very quickly cut a small piece of a large binary file at the end. This piece (5 KB) I need. I am using:

# Include "Binary.au3"

$ bData = FileRead ($hFile)

$ bData = _BinaryRight ($bData, 5000)

FileClose ($ hFile)

This works for a long time. How can I do differently?

TNX ;)

Share this post


Link to post
Share on other sites



Look into _WinAPI_SetFilePointer


Things that I've done..

Icon Resource Editor: icon resource editor 

AutoIt Piano: a piano

AutoIt Unlocker: unlocks files when you want to delete them

Colorful tooltips: a wrapper for the tool tips UDF

Rouge GoogleBot: a full screen animation

ASciTE text editor: a text editor written in autoit

Warning: Posts by this user are subject to change or may disappear without notice.

Share this post


Link to post
Share on other sites

That will only work with the other WinAPI functions. He needs to use the native function FileSetPos before using FileRead.

Good thing you pointed that out, I've been up too damn long today.


Things that I've done..

Icon Resource Editor: icon resource editor 

AutoIt Piano: a piano

AutoIt Unlocker: unlocks files when you want to delete them

Colorful tooltips: a wrapper for the tool tips UDF

Rouge GoogleBot: a full screen animation

ASciTE text editor: a text editor written in autoit

Warning: Posts by this user are subject to change or may disappear without notice.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

YES! thank you very much!

#include <Constants.au3>

$hFile = FileOpen ($hFile, 16)

FileSetPos ( $hFile, -5000, 2 )

$bData = FileRead ( $hFile )

FileClose ( $hFile )

This work very fast ;) Edited by scon

Share this post


Link to post
Share on other sites

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

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0