[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: DEP 5 and directory/file names with spaces



Rob:

As I mentioned, it's not that simple escaping is *hard* -- just that
it can be relatively easy to a) make mistakes; b) not be totally sure
of what the statement really means (short of doing `ls' on those
filenames of course).

Another thing is that it just looks more readable. And the (standard)
diff utility output is nicer (and more helpful). Sure, more helpful
GUI diff programs will show you the exact subsequence which has
changed... But for something so trivial, I can't think of anything
better (hopefully someone else can).

If you have a filename with an \n in it, then you'd need to escape the newline.

In general, the problem is thus:

1. You have to pick some sort of separator, X.
2. No matter what, any uses of X anywhere in a filename needs to be escaped

Now, it's easier if X is as infrequently used as possible. So while it
is indeed possible to have a newline in the middle of your filename;
it is unlikely to be so. As a result, its use as a separator is better
than using spaces or commas -- both of which are believed (by me
anyway) to occur much more frequently than newlines.

Basically, I just think that the less we need to escape, the better in
the end -- because it means less thinking for us, less likely that
we'll make a mistake. And in the end getting accurate data from the
d/copyright file is probably the most important goal.

I'm not saying this is the *most* elegant solution possible. However,
I am saying that it seems like the most elegant solution proposed thus
far (and I'm hoping to hear from others either giving some adjustments
we can make to improve this format, or proposing a much better
alternative).

Hope this helps clarify things.

Cheers,

Jonathan

On Mon, Jun 8, 2009 at 9:28 PM, Robert Collins<robertc@robertcollins.net> wrote:
> On Mon, 2009-06-08 at 10:15 -0400, Jonathan Yu wrote:
>>
>> You know, this is probably a stupid question, but what's wrong with
>> separating file patterns with newlines, as continuations?
>>
>> Files: a b
>>  c
>>  d e f
>>  g.*
>>
>> To me it looks more readable, no escaping or quotes are necessary
>
> Well, this prohibits filenames with \n in them. Not that I do that
> myself, but it is actually something that works :).
>
> Whats so hard about simple escaping?
>
> -Rob
>


Reply to: