Nologic Posted May 1, 2009 Share Posted May 1, 2009 Anyone got any UDF's, links or code samples? Right now I can do (split, trim, concatenate) thou slowly...so if someone has some fast code I'd love to see it as I'm doing things with 5mb packets right now. Lastly I'm looking for a fast way to pad out a binary file with null bytes to a give size. I did find APITailRW but for some reason it throws an exception on my system. Thanks a head of time for any help with this. Link to comment Share on other sites More sharing options...
KaFu Posted May 1, 2009 Share Posted May 1, 2009 (edited) Look at the winapi standard UDF, _WinAPI_CreateFile(), _WinAPI_SetFilePointer(), _WinAPI_ReadFile(), _WinAPI_WriteFile() and _WinAPI_CloseHandle() are the relevant functions. Just created a UDF yesterday to handle filepointers for files > 4 GB ... Func _WinAPI_SetFilePointerEx($hFile, $iPos, $iMethod = 0) ; Set filepointer for files > 4 GB ; by KaFu Local $aResult $aResult = DllCall("kernel32.dll", "dword", "SetFilePointerEx", "hwnd", $hFile, "uint64", $iPos, "uint64*", 0, "dword", $iMethod) If @error Then Return SetError(1, 0, -1) If $aResult[0] = $__WINAPCONSTANT_INVALID_SET_FILE_POINTER Then Return SetError(2, 0, -1) Return $aResult[0] EndFunc ;==>_WinAPI_SetFilePointer Edited May 1, 2009 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Nologic Posted May 1, 2009 Author Share Posted May 1, 2009 sweet many thanks for the heads up. Link to comment Share on other sites More sharing options...
Ascend4nt Posted July 19, 2009 Share Posted July 19, 2009 KaFu, this definitely should be submitted to be added to the standard UDF's. Who nowadays doesn't have >4GB files on their PC's? Thanks for this UDF though - I missed it until I was looking at your superlong signature (which is cool though - I think everyone should include signatures with stuff they've done and useful links) My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now