[Win32utils-devel] win32-file-stat and unc directory paths
djberg96 at gmail.com
Sat Apr 13 15:54:44 UTC 2013
Ok, thanks. What a pain.
I've created a new branch called "ffi2". There I use CreateFile +
GetFileInformationByHandle. That seems to work better for most cases, and
it can deal with UNC paths (both files and directories).
For special devices (pipes, etc) I have to resort to FindFirstFile, but
it's not too bad.
Feel free to take a look and please let me know if there are any problems
with this approach.
PS - Stay safe over there Heesob. NK is acting a bit crazier than usual,
and has me worried.
On Sat, Apr 13, 2013 at 6:48 AM, Heesob Park <phasis at gmail.com> wrote:
> 2013/4/13 Daniel Berger <djberg96 at gmail.com>:
> > Hi everyone,
> > As I'm converting win32-file-stat to use FFI, I've run into an issue
> where I
> > can't seem to successfully call CreateFile on a UNC directory path. It
> > fine if I call it on a file, but not on the directory itself.
> > Using my own local network, this works:
> > # inside stat.rb
> > File::Stat.new("//myhost/users/djberge/documents/foo.txt")
> > But this does not:
> > File::Stat.new("//myhost/users")
> > Which is strange, because in a separate, standalone program it works
> > but I can't see what the difference is. I need a second pair of eyes,
> > please. The code is in git.
> In my test, the latter case files in FindFirstFile instead of CreateFile:
> The network name cannot be found. - FindFirstFile (SystemCallError)
> I can see following statement in the msdn documentation of FindFirst:
> On network shares, you can use an lpFileName in the form of the
> following: "\\Server\Share\*". However, you cannot use an lpFileName
> that points to the share itself; for example, "\\Server\Share" is not
> I guess you will succeeds in case of
> Park Heesob
> win32utils-devel mailing list
> win32utils-devel at rubyforge.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the win32utils-devel