Displaying 20 results from an estimated 600 matches similar to: "Calling CreateFile on an instance of File - possible?"
2004 Nov 07
2
Problems with DeviceIoControl()
Hi all,
Thanks to Wayne and Park, I''ve got something like this
now:
static VALUE file_set_compressed(VALUE self, VALUE
rbBool){
HANDLE h;
BOOL rv;
DWORD dwBytesReturned;
int fn;
USHORT inBuf = COMPRESSION_FORMAT_DEFAULT;
if((rbBool != Qtrue) && (rbBool != Qfalse)){
rb_raise(rb_eTypeError,"Argument must be true or
false");
}
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,
2004 Nov 21
3
win32-file, overlapped added
Hi all,
I''ve got overlapped and offset support in both nread and nwrite. The only
thing left before I want to release this (as 0.4.0) is to get NO_BUFFERING
to work. Unfortunately, I can''t get it to work.
Park, I looked at that site you sent (and borrowed some code from it), but I
don''t see anything special happening for NO_BUFFERING. I thought it
required
2005 Jan 20
1
ChangeNotify help wanted
Hi all,
I''ve checked in some code to win32-changenotify. Unfortunately, it
doesn''t work right. I need some help. I don''t understand what,
exactly, I''m supposed to pass to ReadDirectoryChangesW() for the 2nd
argument, nor how to read the data back out.
There''s also a WCHAR issue that needs to be worked out with regards to
the FileName
2004 Nov 11
2
File.open on a directory?
Hi all,
Windows 2000
Ruby 1.8.2 RC9
Is it possible to call File.open on a directory in Windows? I always get
Errno::EACCES, even though there are no special settings on the directories
I''ve tried and I have full access.
Dan
2003 Sep 24
0
CreateFile for EXE images vs other files
This question isn't directly Samba related, but Samba has helped me figure out part of the problem. When I CreateFile on an existing file like so:
CreateFile(FileName, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
Samba shows that I have the file opened with this type of lock
DENY_NONE 0x20089 RDONLY
When the file is locked in
2018 Aug 18
1
[PATCH] move CreateFile() function from libFLAC
This patch renames flac_internal_CreateFile_utf8() function to
grabbag__CreateFile_utf8() and
moves it from /src/libFLAC/windows_unicode_filenames.c into
src/share/grabbag/file.c
This function is not used by libFLAC anyway.
After this, it should be possible to compile libFLAC as UWP.
In the old code there were 3 different #if conditionals around the
code that uses CreateFile_utf8():
1) #ifdef
2004 Nov 11
0
File.nopen alpha - another followup
Hi all,
> fh = File.nopen("C:\\temp.txt",File::WRITE_ATTRIBUTES)
> fh.hidden = true
> fh.close
>
> I get "test.rb:16:in `hidden='': cannot convert nil into
> String (TypeError)"
It looks like this line is the culprit:
rbPath = rb_funcall(self,rb_intern("path"),0,0);
Hm...we could use GetFullPathName() if rbPath is nil. That, however,
2007 Jan 06
4
spec command and windows
Hello,
Today I ran into some frustration with spec and windows.
We have a series of plugins that have either test suites and/or spec suites.
To avoid environment collisions, we have a "master" test suite that spawns
new process for all of the test suites and spec suites.
Every works great on posix. Unfortunately on windows, spec was not found.
The only way I figured to ensure we get
2006 Dec 14
11
Tweak to win32-eventlog
All,
I got a bug report from Greg Holmes where the description wasn''t being
returned properly. At the moment, if there''s no event associated with
the event id, then the description is empty.
However, it turns out that there can still be associated information
about the event. So, I propose the following tweak to the
get_description private method:
# If FormatMessage()
2008 May 11
3
converting a RSTRING to an OLESTR
Hi,
I was going to modify the TaskScheduler#save method to take an optional
file name. But, I need to convert a Ruby string to an OLE string. I
thought I could use this:
http://msdn.microsoft.com/en-us/library/ms692615(VS.85).aspx
But, it only appears to accept literal string constants.
Any other suggestions?
Thanks,
Dan
2003 Oct 25
9
Windows Compile Error
I''ve gotten a lot farther building wxRuby than I did a few months ago. But
its getting late here and I''m going to bed.
In the meantime, does anyone know why I''m getting this compile error:
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
cl -MD -Zi -O2b2xg- -G6
2005 Aug 29
2
floating point control on windows
Hi,
I'm sure that this question has come up many times before. When I load an R
extension dll I've built with the Microsoft compiler, I get the warning:
Warning message:
DLL attempted to change FPU control word from 8001f to 9001f
So, what I did to try to fix the problem (to my knowledge, Microsoft will
not support compile time switching of floating point control until version
2005 May 01
3
win32-dir 0.1.0 compile problems
I tried to download/compile/install win32-dir, but I couldn''t get it to
go. Over a private email Daniel Berger had me...
"Curious. What platform are you on exactly? Try
modifying the extconf.rb file. Add
''have_library("SHFolder")'' above
''have_library("shell32")''. If that doesn''t work, try
uncommenting the other
2006 Apr 18
1
Sponsoring the Sponsors of the Summer of Code.
I know that the folks at Ruby Central (David Black, Chad Fowler, Rich
Kilmer, et al) had a big impact on Ruby being added to Google''s
''Summer of Code''. They tried last year, but they made it happen this
year.
Based on that, I''ve made a donation to Ruby Central [1] to support the
work that they do (as I did last year). I''d love to see my (almost a)
2007 Oct 21
2
Simulating RUBY_CRITICAL
Hi all,
I''ve added some critical section methods to the Windows::Synchronize
module in the windows-pr library (in CVS). Looking at the RUBY_CRITICAL
macro from rubysig.h, it basically looks like this (in pure Ruby):
def RUBY_CRITICAL(&block)
critical_section = [0].pack(''L'')
InitializeCriticalSection(critical_section)
2008 May 06
4
DeviceIoControl + IOCTL_DISK_GET_DRIVE_GEOMETRY problem
Hi all,
Ok, what am I doing wrong here?
require ''windows/device_io''
require ''windows/handle''
require ''windows/error''
include Windows::DeviceIO
include Windows::Handle
include Windows::Error
fh = File.open(''test.txt'') # Assume you have this
handle = get_osfhandle(fh.fileno)
if handle == INVALID_HANDLE_VALUE
puts
2006 Feb 22
8
Install Rails
My computer doesn''t have network . So when I installed Rails , I had the
following error :
C:\ruby\bin>"c:\ruby\bin\ruby.exe" "c:\ruby\bin\gem" install rails
--include-dep endencies Attempting local installation of ''rails'' Local
gem file not found: rails*.gem Attempting remote installation of ''rails''
ERROR: While executing