Displaying 1 result from an estimated 1 matches for "seg_array".
Did you mean:
reg_array
2007 Oct 09
5
Playing with ReadFileScatter()
...ror())
end
sysbuf = 0.chr * 40
GetSystemInfo(sysbuf)
page_size = sysbuf[8,4].unpack(''L'')[0] # dwPageSize
file_size = File.size(file)
# FILE_SEGMENT_ELEMENT
fse_struct = (0.chr * page_size) + (0.chr * 8) # Buffer + Align.
seg_array = (0.chr * (file_size / fse_struct.size)) + 0.chr
olapped = 0.chr * 20
bool = ReadFileScatter(handle, seg_array, file_size, nil, olapped)
raise SystemCallError.new(GetLastError())
end
sleep 0.01 unless HasOverlappedIoCompleted(olapped)
unless CloseH...