[Patch] To handle Win32 pipe names

Corinna Vinschen vinschen@redhat.com
Wed May 19 08:52:00 GMT 2004


On May 17 12:57, Stephen Cleary wrote:
> Attached is a patch against the current CVS sources, with a ChangeLog. This 
> patch allows Win32 pipe names to be opened as files.

that's still not quite what I had in mind.  I'd like to see as less special
windows path handling in Cygwin as possible.  A //foo/pipe/whatever path is
just like any other UNC path and could be handled as such, no extra code
should be necessary.  //./pipe/whatever should also go through without any
extra code so the whole idea would be to do exactly nothing, except the
existing code has a bug, of course.  I really don't care for stat.  If
Windows named pipes are recognized as files, so be it.

I've just quickly stepped through the existing code and it looks like
\\.\foo paths can be opened normally on NT.  Just stat seems to have
a problem, since stat_worker checks for fh->exists() at one point and
GetFileAttributes returned INVALID_FILE_ATTRIBUTES on devices.  So that
explains your patch to symlink_info::check.  But it's not exactly right
to circumvent this only for pipes.  Any \\.\foo path should get the
same handling.  Wouldn't it be more straightforward to use is_unc_share
or a slightly modified version of is_unc_share?

> The legal paperwork just got in the mail this morning, but this patch may 
> be small enough that it wouldn't require it anyway.

Unfortunately it isn't.  Patches small enough to go in without paperwork
are "trivial" patches.  The rule of thumb is that such a patch shouldn't
change more than 10 lines of code.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Co-Project Leader          mailto:cygwin@cygwin.com
Red Hat, Inc.

More information about the Cygwin-patches mailing list