tbaror Posted February 27, 2009 Posted February 27, 2009 (edited) Hello, i am trying to figure out _WinAPI_WriteFile syntax ,my goal is to create a script that i can determine the write block size and and even throttle IO/SEC or Mbytes/sec ,finally measure disk throughput & latency . each operation will be measured and calculated by TimerInit /TimerDiff i wonder if _WinAPI_WriteFile is the right function to do ,if yes i would like to get help with examples. please advice Thanks Edited February 28, 2009 by tbaror
monoceres Posted March 1, 2009 Posted March 1, 2009 Example of writing 1 MB of random crap with WriteFile() #include <winapi.au3> $handle=_WinAPI_CreateFile("test.data",1,4) $size=1024*1024 $buffer=DllStructCreate("int["&$size/4&"]") For $i=0 To $size/4-1 DllStructSetData($buffer,1,Random(0,2^31-1,1),$i+1) Next Local $written _WinAPI_WriteFile($handle,DllStructGetPtr($buffer),DllStructGetSize($buffer),$written) _WinAPI_CloseHandle($handle) Broken link? PM me and I'll send you the file!
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