* DOS Special Names
@ 2002-06-05 12:55 Michael Eager
2002-06-05 13:48 ` Larry Hall (RFK Partners, Inc)
0 siblings, 1 reply; 4+ messages in thread
From: Michael Eager @ 2002-06-05 12:55 UTC (permalink / raw)
To: Cygwin Mailing List
I've run into a problem creating a regular file with the name
COM20000. I can create this file from Windows, either using
fopen() or in a Command window, but not when using Cygwin.
Windows does prevent creating files named COMx, where x is a
single digit.
The code in winsup/cygwin/path.cc checks to see if the file
name is COM followed by any integer, not just a single digit.
Is this intentional or an error?
Shouldn't Cygwin check to see if there is an installed driver
named COM (or AUX, etc.) rather than just assume that all COMxxxx
are supposed to be devices?
--
Michael Eager eager@mvista.com 408-328-8426
MontaVista Software, Inc. 1237 E. Arques Ave., Sunnyvale, CA 94085
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: DOS Special Names
2002-06-05 12:55 DOS Special Names Michael Eager
@ 2002-06-05 13:48 ` Larry Hall (RFK Partners, Inc)
2002-06-05 21:10 ` Michael Eager
0 siblings, 1 reply; 4+ messages in thread
From: Larry Hall (RFK Partners, Inc) @ 2002-06-05 13:48 UTC (permalink / raw)
To: Michael Eager, Cygwin Mailing List
At 03:29 PM 6/5/2002, Michael Eager wrote:
>I've run into a problem creating a regular file with the name
>COM20000. I can create this file from Windows, either using
>fopen() or in a Command window, but not when using Cygwin.
>Windows does prevent creating files named COMx, where x is a
>single digit.
>
>The code in winsup/cygwin/path.cc checks to see if the file
>name is COM followed by any integer, not just a single digit.
>Is this intentional or an error?
>
>Shouldn't Cygwin check to see if there is an installed driver
>named COM (or AUX, etc.) rather than just assume that all COMxxxx
>are supposed to be devices?
I agree that it makes sense for Cygwin not to restrict more file names
than Windows does. Feel free to submit a patch for this, if you're so
inclined.
Larry Hall lhall@rfk.com
RFK Partners, Inc. http://www.rfk.com
838 Washington Street (508) 893-9779 - RFK Office
Holliston, MA 01746 (508) 893-9889 - FAX
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: DOS Special Names
2002-06-05 13:48 ` Larry Hall (RFK Partners, Inc)
@ 2002-06-05 21:10 ` Michael Eager
0 siblings, 0 replies; 4+ messages in thread
From: Michael Eager @ 2002-06-05 21:10 UTC (permalink / raw)
To: Larry Hall (RFK Partners, Inc); +Cc: Cygwin Mailing List
"Larry Hall (RFK Partners, Inc)" wrote:
>
> At 03:29 PM 6/5/2002, Michael Eager wrote:
> >I've run into a problem creating a regular file with the name
> >COM20000. I can create this file from Windows, either using
> >fopen() or in a Command window, but not when using Cygwin.
> >Windows does prevent creating files named COMx, where x is a
> >single digit.
> >
> >The code in winsup/cygwin/path.cc checks to see if the file
> >name is COM followed by any integer, not just a single digit.
> >Is this intentional or an error?
> >
> >Shouldn't Cygwin check to see if there is an installed driver
> >named COM (or AUX, etc.) rather than just assume that all COMxxxx
> >are supposed to be devices?
>
> I agree that it makes sense for Cygwin not to restrict more file names
> than Windows does. Feel free to submit a patch for this, if you're so
> inclined.
Index: path.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/path.cc,v
retrieving revision 1.219
diff -u -r1.219 path.cc
--- path.cc 5 Jun 2002 04:01:42 -0000 1.219
+++ path.cc 6 Jun 2002 01:25:41 -0000
@@ -916,7 +916,7 @@
devn = FH_MEM;
unit = 4;
}
- else if (deveqn ("com", 3) && (unit = digits (name + 3)) >= 0)
+ else if (deveqn ("com", 3) && (unit = digits (name + 3)) >= 0 && unit < 10)
devn = FH_SERIAL;
else if (deveqn ("ttyS", 4) && (unit = digits (name + 4)) >= 0)
{
@@ -1070,7 +1070,7 @@
if (p)
unix_path = p + 1;
if (udeveqn ("com", 3)
- && (unit = digits (unix_path + 3)) >= 0)
+ && (unit = digits (unix_path + 3)) >= 0 && unit < 10)
devn = FH_SERIAL;
}
--
Michael Eager eager@mvista.com 408-328-8426
MontaVista Software, Inc. 1237 E. Arques Ave., Sunnyvale, CA 94085
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: DOS Special Names
@ 2002-06-06 7:45 Bernard Dautrevaux
0 siblings, 0 replies; 4+ messages in thread
From: Bernard Dautrevaux @ 2002-06-06 7:45 UTC (permalink / raw)
To: 'Michael Eager', Larry Hall (RFK Partners, Inc)
Cc: Cygwin Mailing List
> -----Original Message-----
> From: Michael Eager [mailto:eager@mvista.com]
> Sent: Thursday, June 06, 2002 3:28 AM
> To: Larry Hall (RFK Partners, Inc)
> Cc: Cygwin Mailing List
> Subject: Re: DOS Special Names
>
>
> "Larry Hall (RFK Partners, Inc)" wrote:
> >
> > At 03:29 PM 6/5/2002, Michael Eager wrote:
> > >I've run into a problem creating a regular file with the name
> > >COM20000. I can create this file from Windows, either using
> > >fopen() or in a Command window, but not when using Cygwin.
> > >Windows does prevent creating files named COMx, where x is a
> > >single digit.
> > >
> > >The code in winsup/cygwin/path.cc checks to see if the file
> > >name is COM followed by any integer, not just a single digit.
> > >Is this intentional or an error?
> > >
> > >Shouldn't Cygwin check to see if there is an installed driver
> > >named COM (or AUX, etc.) rather than just assume that all COMxxxx
> > >are supposed to be devices?
> >
> > I agree that it makes sense for Cygwin not to restrict more
> file names
> > than Windows does. Feel free to submit a patch for this,
> if you're so
> > inclined.
>
> Index: path.cc
> ===================================================================
> RCS file: /cvs/src/src/winsup/cygwin/path.cc,v
> retrieving revision 1.219
> diff -u -r1.219 path.cc
> --- path.cc 5 Jun 2002 04:01:42 -0000 1.219
> +++ path.cc 6 Jun 2002 01:25:41 -0000
> @@ -916,7 +916,7 @@
> devn = FH_MEM;
> unit = 4;
> }
> - else if (deveqn ("com", 3) && (unit = digits (name + 3)) >= 0)
> + else if (deveqn ("com", 3) && (unit = digits (name + 3))
> >= 0 && unit < 10)
You should in fact rather write:
else if (deveqn ("com", 3) && name[3] >= '1' && name[3] <= '9' && name[4]
== 0)
(presuming name is just the device name, accepting also '/' and '\' if name
is the full path name). Your patch rejects both "COM0" and "COM01", which
are legal; only "COM1" to "COM9" are illegal (I just check on
NT-4.0/SP6a)...
> devn = FH_SERIAL;
> else if (deveqn ("ttyS", 4) && (unit = digits (name + 4)) >= 0)
> {
> @@ -1070,7 +1070,7 @@
> if (p)
> unix_path = p + 1;
> if (udeveqn ("com", 3)
> - && (unit = digits (unix_path + 3)) >= 0)
> + && (unit = digits (unix_path + 3)) >= 0 && unit < 10)
should do the same here
> devn = FH_SERIAL;
> }
>
>
> --
> Michael Eager eager@mvista.com 408-328-8426
> MontaVista Software, Inc. 1237 E. Arques Ave., Sunnyvale, CA 94085
>
> --
> Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting: http://cygwin.com/bugs.html
> Documentation: http://cygwin.com/docs.html
> FAQ: http://cygwin.com/faq/
>
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-06-06 14:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-05 12:55 DOS Special Names Michael Eager
2002-06-05 13:48 ` Larry Hall (RFK Partners, Inc)
2002-06-05 21:10 ` Michael Eager
2002-06-06 7:45 Bernard Dautrevaux
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).