Jump to content

TailRW.au3 UDF Demo


randallc
 Share

Recommended Posts

Hi, [this attempt was superceded by further version at following post;

APITailRW.zip]

Derived from Larry's (cf Zedna) UDF API.

1. Read any tail very fast.

2. write to any tail line very fast.

3. Write to any line very fast (especially if trim to NOT change file length! 30msec most huge files) , but also with "individual" line replace or insert (10x as fast, say, as _fileWriteLine rto an individual line).

Best, Randall

[demo for somebody to do proper UDF perhaps?]

;ReadLine3.au3
#include "TailRW.au3"
$s_Test = FileOpenDialog("Choose File", @ScriptDir, "Files (*.exe;*.dll;*.txt)", 1)
Local $i_WriteLineNumTail = 10 
$timer2 = TimerInit()
;~  __FileReadLine($s_File, $i_LineNumber = -1, $i_Beginning = 1,$i_ToEnd=0, $i_BufferSize = 8388608)
$s_ReadLine = __FileReadLine ($s_Test, -$i_WriteLineNumTail, 1,1) ;;** READS from the TAIL if Negative line number [to the edn if 4th parm=1]
ConsoleWrite("__FileReadLine beginning APIreeadLINE=" & @LF & $s_ReadLine & @LF & Round(TimerDiff($timer2), 1) & "msecs"& @LF)
Edited by randallc
Link to comment
Share on other sites

  • 3 months later...
  • 3 months later...

@randall -- i didn't notice that you were referencing the API in TailRW... at some point i'd love to see au3 expose the pointer so we can write to an arbitrary location in a file natively, that method would likely be as fast or faster than tail...one day when i'm bored i'll speed check.

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Link to comment
Share on other sites

  • 1 month later...

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
 Share

  • Recently Browsing   0 members

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