delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/06/03/22:43:05

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Info: This message was accepted for relay by
smtp03.mrf.mail.rcn.net as the sender used SMTP authentication
X-Trace: UmFuZG9tSVb2hMF98esZw7/I9gAa6ZKo+JEGVTLWfuMSFI9/rBzUCQCCp6n/nYsE
Message-ID: <3EDD5C74.5040006@cygwin.com>
Date: Tue, 03 Jun 2003 22:41:56 -0400
From: Larry Hall <cygwin-lh AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Greg Fenton <greg_fenton AT yahoo DOT com>
CC: cygwin AT cygwin DOT com
Subject: Re: Path separator
References: <20030604022225 DOT 82119 DOT qmail AT web40609 DOT mail DOT yahoo DOT com>
In-Reply-To: <20030604022225.82119.qmail@web40609.mail.yahoo.com>

Greg Fenton wrote:
> --- Larry Hall <cygwin-lh AT cygwin DOT com> wrote:
> 
>>Max is right (surprised Max? ;-) )  But I want to point out something
>>else about what you've said.  If your main concern is paths, don't
>>convert '/' to '\'.  Windows understands both under the hood. 
>>(Cygwin
>>does too but that's another matter).  However, this is the least of
>>your problems as Max clearly states.
>>
> 
> 
> 
> Yes, Max is right.  I hadn't thought about the difference between a
> "native win32" environment vs. "from a DOS prompt on a system that has
> Cygwin in its path" (I rarely, if ever, run in a "native win32"
> environment...)
> 
> I don't understand why we don't just get MSFT to ship cygwin1.dll... 
> :-)
> 
> One last point: not all flavours of Windows that are targetted for
> SWISH-E support the "/" vs. "\" (e.g. Win95/98).  At least, I don't
> think they support it...but again, its been a long while since I've sat
> in front of such a box.


 From the MSDN:

File Name Conventions
Although each file system can have specific rules about the formation of 
individual components in a directory or file name, all file systems follow the 
same general conventions: a base file name and an optional extension, separated 
by a period. For example, the MS-DOS FAT file system supports 8 characters for 
the base file name and 3 characters for the extension. This is known as an 8.3 
file name. The FAT file system and NTFS support file names that can be up to 255 
characters long. This is known as a long file name. To get an MS-DOS file name 
given a long file name, use the GetShortPathName function. To get the full path 
of a file, use the GetFullPathName function.

Both file systems use the backslash (\) character to separate directory names 
and the file name when forming a path.

General rules for applications creating names for directories and files or 
processing names supplied by the user include the following:

Use any character in the current code page for a name, but do not use a path 
separator, a character in the range 0 through 31, or any character explicitly 
disallowed by the file system. A name can contain characters in the extended 
character set (128–255).

Use the backslash (\), the forward slash (/), or both to separate components in 
a path. No other character is acceptable as a path separator. Note that UNC 
names must adhere to the following format: \\server\share.

.
.
.


So there may be a need to backslashify the UNC portion of a path.  Other
than that, forward slashes are fine.




-- 
Larry Hall                              http://www.rfk.com
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
838 Washington Street                   (508) 893-9889 - FAX
Holliston, MA 01746


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019