Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Issue 274043: Arcane bits of path trivia (Closed)

Created:
11 years, 2 months ago by Mark Mentovai
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com, brettw+cc_chromium.org
Visibility:
Public.

Description

Add a comment to file_path.h describing a couple of bits of trivia that came up today. We should have these documented. Now we do. BUG=0 TEST={} Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=28946

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+28 lines, -0 lines) Patch
M base/file_path.h View 2 chunks +28 lines, -0 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
Mark Mentovai
11 years, 2 months ago (2009-10-14 02:33:02 UTC) #1
Erik does not do reviews
11 years, 2 months ago (2009-10-14 03:48:19 UTC) #2
LGTM

Thanks for doing this.

Erik


On Tue, Oct 13, 2009 at 7:33 PM,  <mark@chromium.org> wrote:
> Reviewers: Avi, Erik Kay,
>
> Description:
> Add a comment to file_path.h describing a couple of bits of trivia that c=
ame
> up today. =A0We should have these documented. =A0Now we do.
>
> BUG=3D0
> TEST=3D{}
>
> Please review this at http://codereview.chromium.org/274043
>
> SVN Base: svn://svn.chromium.org/chrome/trunk/src/
>
> Affected files:
> =A0M =A0 =A0 base/file_path.h
>
>
> Index: base/file_path.h
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- base/file_path.h =A0 =A0(revision 28932)
> +++ base/file_path.h =A0 =A0(working copy)
> @@ -20,6 +20,8 @@
> =A0// =A0 Linux does not specify an encoding, but in practice, the locale=
's
> =A0// =A0 character set may be used.
> =A0//
> +// For more arcane bits of path trivia, see below.
> +//
> =A0// FilePath objects are intended to be used anywhere paths are. =A0An
> =A0// application may pass FilePath objects around internally, masking th=
e
> =A0// underlying differences between systems, only differing in implement=
ation
> @@ -68,6 +70,32 @@
> =A0// RTL UI.
> =A0//
> =A0// This is a very common source of bugs, please try to keep this in mi=
nd.
> +//
> +// ARCANE BITS OF PATH TRIVIA
> +//
> +// =A0- A double leading slash is actually part of the POSIX standard.
> =A0Systems
> +// =A0 =A0are allowed to treat // as an alternate root, as Windows does =
for UNC
> +// =A0 =A0(network share) paths. =A0Most POSIX systems don't do anything=
 special
> +// =A0 =A0with two leading slashes, but FilePath handles this case prope=
rly
> +// =A0 =A0in case it ever comes across such a system. =A0FilePath needs =
this
> support
> +// =A0 =A0for Windows UNC paths, anyway.
> +// =A0 =A0References:
> +// =A0 =A0The Open Group Base Specifications Issue 7, sections 3.266
> ("Pathname")
> +// =A0 =A0and 4.12 ("Pathname Resolution"), available at:
> +//
> =A0http://www.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html=
#tag_03_266
> +//
> =A0http://www.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html=
#tag_04_12
> +//
> +// =A0- Windows treats c:\\ the same way it treats \\. =A0This was inten=
ded to
> +// =A0 =A0allow older applications that require drive letters to support=
 UNC
> paths
> +// =A0 =A0like \\server\share\path, by permitting c:\\server\share\path =
as an
> +// =A0 =A0equivalent. =A0Since the OS treats these paths specially, File=
Path
> needs
> +// =A0 =A0to do the same. =A0Since Windows can use either / or \ as the
> separator,
> +// =A0 =A0FilePath treats c://, c:\\, //, and \\ all equivalently.
> +// =A0 =A0Reference:
> +// =A0 =A0The Old New Thing, "Why is a drive letter permitted in front o=
f UNC
> +// =A0 =A0paths (sometimes)?", available at:
> +// =A0 =A0http://blogs.msdn.com/oldnewthing/archive/2005/11/22/495740.as=
px
> +
> =A0#ifndef BASE_FILE_PATH_H_
> =A0#define BASE_FILE_PATH_H_
>
>
>
>

Powered by Google App Engine
This is Rietveld 408576698