On Tue, Mar 18, 2003 at 08:51:14AM +0100, Andreas Aardal Hanssen wrote:
> I have a refinement. A single dot at the start of a filename refers to a
> single dot at the start of an IMAP mailbox. Anywhere else in the file
> name, two consecutive dots represent a single dot and a single dot
> represents the hierarchy seperator/delimiter.
>
> .foo -> .foo
> ..foo -> ./foo
> .foo..bar -> .foo.bar
> .foo.bar -> .foo/bar
>
> So:
>
> July 2nd.. -> July 2nd.
> July.2nd -> July/2nd
>
> This is completely unambiguous.
In the interest of being pedantic...
Is:
July...2nd -> July/.2nd
Or:
July...2nd -> July./2nd
If it is the former, how is the latter represented, if the latter, how about the
former? You'll need more information to properly encode both a value and an escape
character. You could expand the separator to two characters, an escape character and
a data character ('..' vs. '.+' or '.\' or '.!') but it is of course ugly.
Then there's the option of adding another escape character, such as the infamous '\'.
'foo\..bar' is 'foo./bar' and 'foo.\.bar' is 'foo/.bar' and then you have to add '\\'
as mapping to the '\' character. And declare '\[anything]' as mapping to '[anything]'
just so you have a deterministic mapping of 'foo\\\bar' (not that binc would create
such a thing, but we can't just crash if we find it).
C=)
--
--------------------------------------------------------------------------
Better the hard truth than the comforting fantasy. -- Carl Sagan
--------------------------------------------------------------------------
Caskey <caskey*technocage.com> /// TechnoCage Inc.
--------------------------------------------------------------------------
A presumption on your part does not constitute an obligation on my part.