Jump to content

Recommended Posts

Posted (edited)

my task is to read out metadata of 3,000 tif files, 3 MB each. most of the needed data is in the script header, so i can use this code

Local $open=FileOpen($file,16),$r=FileRead($open,700)
            FileClose($open)

which only reads out the first 700 bytes of the pics. my script manages this in 20 seconds for all 3,000 files.

now the problem is, i need also some bytes, maybe 100, from the end of the file. if i read the entire file out, it needs several hours (estimated). the autoit logic always reads a file from the start.

question is: does anyone know a method to only extract x bytes from the end of a file ?

thx for your help

E.

edit: maybe _WinAPI_ReadFile() can do that ? if so, can i have an example how to do it ?

Edited by Edano

[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

  • Solution
Posted (edited)

  On 6/19/2013 at 10:40 AM, KaFu said:

Something like this should work.

$hFile = fileopen("test.tif")

FileSetPos($hFile,-100,2)

$sData = FileRead($hFile)

.

FileSetPos() !!! wow

never seen that before, and i've been using autoit since five years. is that new ?

excellent Kafu, thx.

i'll make some speed tests, but it looks exactly what i needed

E.

 

edit: yep, speed test passed :) very coooool. 10 seconds !!!

Edited by Edano

[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Posted
Posted
  On 6/19/2013 at 12:49 PM, Danyfirex said:

FileSetPos() was added on 2009

regards

.

strange. i never came across it.

[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Posted

The last version of AutoIt came out in December 2011, so nothing new has been added in the last 18months.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...