search for: file_flag_no_buffering

Displaying 6 results from an estimated 6 matches for "file_flag_no_buffering".

2007 Sep 25
2
Using callbacks with ReadFileEx
...hronize class Error < StandardError; end def self.read_async(file, length=nil, offset=0, &block) handle = CreateFile( file, FILE_READ_DATA, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED | FILE_FLAG_NO_BUFFERING, 0 ) if handle == INVALID_HANDLE_VALUE raise Error, get_last_error end func = Win32::API::Callback.new(''LLP'', ''V''){ block.call } overlapped = 0.chr * 20...
2004 Nov 17
1
nread and nwrite optimizations
...d sucked it into memory using Ruby''s File#read method just fine. However, when I tried to use File#nread, it eventually died with a memory allocation error. Since I have 1GB of RAM (and wasn''t using much), I''m not sure why it would complain. The second issue is getting FILE_FLAG_NO_BUFFERING to work. Mostly I just want to see if this will lead to a significant performance increase with reads and writes. But, using it has certain requirements that I don''t totally understand. Any ideas for these two issues are definitely welcome. Dan
2010 Mar 25
4
CreateFile \\\\.\\x: non-root
Hello, I have a usb data aquisition device interfaced by mass storage protocol. I open it like: hEcgDrive=CreateFile("\\\\.\\g:", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_NO_BUFFERING | FILE_FLAG_WRITE_THROUGH | FILE_FLAG_OVERLAPPED, NULL); for communication I use DeviceIoControl(hEcgDrive, IOCTL_SCSI_PASS_THROUGH_DIRECT, .... with a 'custom' scsi operation code as wrapper. On Wine-1.1.30. under UHU linux (2.6.23.9-1) the program can open the device only if run as...
2004 Nov 25
0
getdiskfreespace
Hi all, I was just working on the FILE_FLAG_NO_BUFFERING stuff again. I''m a little confused about determining the cluster size. According to the MSDN docs, using GetDiskFreeSpace() on disks over 2GB may return incorrect values. Some threads on comp.os.ms-windows.* seem to support this as well. I did come across this, however: http://www....
2007 Oct 09
5
Playing with ReadFileScatter()
...::MSVCRT::IO extend Windows::SystemInfo include Windows::File def self.readlines(file, sep = $INPUT_RECORD_SEPARATOR) handle = CreateFile( file, GENERIC_READ, FILE_SHARE_READ, nil, OPEN_EXISTING, FILE_FLAG_OVERLAPPED | FILE_FLAG_NO_BUFFERING, nil ) if handle == INVALID_HANDLE_VALUE raise SystemCallError.new(GetLastError()) end sysbuf = 0.chr * 40 GetSystemInfo(sysbuf) page_size = sysbuf[8,4].unpack(''L'')[0] # dwPageSize file_size = File.size(file...
2008 Mar 21
0
Wine release 0.9.58
...printf format warnings. makefiles: Consider all .res files as object files. winex11: Store a pointer to the X11 event currently being handled instead of a simple count. ntdll: Implemented NtReadFileScatter. ntdll: Implemented NtWriteFileGather. kernel32: Propagate the FILE_FLAG_NO_BUFFERING CreateFile flag to ntdll. kernel32: Implemented ReadFileScatter and WriteFileGather. shell32/tests: Remove spurious linefeeds in error messages. winex11: Fix bug report address. winex11: Fix typo that was causing superfluous updates of the visible rect. winex11: Avoid...