Groups | Search | Server Info | Login | Register


Groups > comp.unix.programmer > #16269

Re: Long filenames in DOS/Windows and Unix/Linux

Path csiph.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Keith Thompson <Keith.S.Thompson+u@gmail.com>
Newsgroups comp.unix.programmer
Subject Re: Long filenames in DOS/Windows and Unix/Linux
Date Tue, 03 Sep 2024 15:16:36 -0700
Organization None to speak of
Lines 63
Message-ID <87seug1iyj.fsf@nosuchdomain.example.com> (permalink)
References <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com> <ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me> <ubg8a8$2t20l$1@dont-email.me> <vaubbo$1d324$1@news.xmission.com> <vauknd$uvji$1@dont-email.me> <20240903084440.0000663d@gmail.com> <20240903103327.395@kylheku.com> <20240903113937.000008a3@gmail.com> <20240903130000.933@kylheku.com> <20240903132547.00000656@gmail.com>
MIME-Version 1.0
Content-Type text/plain
Injection-Date Wed, 04 Sep 2024 00:16:37 +0200 (CEST)
Injection-Info dont-email.me; posting-host="0c8cc2609bc8d9fbbbb3d106ce45f413"; logging-data="3664048"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18+HnX6+/KVjy/r7z2f5qCe"
User-Agent Gnus/5.13 (Gnus v5.13)
Cancel-Lock sha1:ETDWlLvEEsqL0Hz3Z41dp+NYfCQ= sha1:2RKlvdanfi4aIQ3Bi9ww1RVYOo4=
Xref csiph.com comp.unix.programmer:16269

Show key headers only | View raw


John Ames <commodorejohn@gmail.com> writes:
> On Tue, 3 Sep 2024 20:11:28 -0000 (UTC)
> Kaz Kylheku <643-408-1753@kylheku.com> wrote:
>
>> Because it is based on a strawman interpretation of the "no spaces"
>> rule. That strawman interpretation is that there are no other rules
>> used in combination with the "no spaces" rule, and thus that any
>> ridiculous name is fine, just as long as it doesn't contain spaces.
>> 
>> And so, look how unreadable is this 100 character name in CamelCase!
>> Q.E.D. no spaces is a bad recommendation!
>
> Well, there were no other factors *presented* alongside the blanket
> statement that spaces in filenames are unnecessary, so it would appear
> on the face of it to be an accurate assessment of the claim being made,
> which wasn't in a post of yours to begin with.
>
> And I'd still like to know who died and made whom king where filenames
> and spaces therein are concrned.

There is no official "rule" about spaces in filenames, though I can
imagine easily imagine that some organizations and projects have
rules forbidding them.  A couple of data points: The gcc git repo
contains 137394 files and none of them have spaces in their names.
The Linux kernel git repo contains 85803 files, and exactly one has
spaces in its name.  In either cases, I don't know whether this is
due to some hard rule.

Spaces in file names are likely not to be an issue if you interact
with the filesystem via a GUI like Windows Explorer *or* if you use
a scripting language like Perl or Python that requires strings used
as filenames to be enclosed in quotation marks.  In those contexts,
space is just another character.

It can be a real issue if you're interacting via shell commands.
If I happen to know that none of the files I'm working with have
spaces (or other problematic characters) in their names, a lot of
things become easier -- but risky if there's a funny character I'm
not aware of.  For example, I might type something like:

    for file in * ; do cp -p $file $file.bak ; done

(Yes, this skips files whose names start with '.'; I usually don't
need to worry about that) I never (well, hardly ever) create files
with spaces in their names.  I typically use '-' rather than '
' to delimit words in file names.  When I have to work with such
files, I can do it, but it requires a bit of extra effort.

And if, for example, I'm writing a shell script that needs to be
generally useful, I'll spend the extra effort to make sure it works
with arbitrary file names (or I'll write it in a scripting language
where it's not an issue).  But I don't typically bother if I know
I'm working with files that I created.

It would be ideal, I suppose, if interactive shells dealt better with
spaces in file names, but I'm not sure how that could be achieved.
In current shells, removing two files named "foo" and "bar" is easy, and
removing a single file named "foo bar" requires some extra effort.  I
find that to be a good tradeoff.

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */

Back to comp.unix.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin) gazelle@shell.xmission.com (Kenny McCormack) - 2024-08-31 05:57 +0000
  Re: Long filenames in DOS/Windows and Unix/Linux Richard Kettlewell <invalid@invalid.invalid> - 2024-08-31 09:27 +0100
    Re: Long filenames in DOS/Windows and Unix/Linux Muttley@dastardlyhq.com - 2024-08-31 08:39 +0000
    Re: Long filenames in DOS/Windows and Unix/Linux Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-08-31 23:34 +0000
      Re: Long filenames in DOS/Windows and Unix/Linux Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-01 07:03 +0000
        Re: Long filenames in DOS/Windows and Unix/Linux Nuno Silva <nunojsilva@invalid.invalid> - 2024-09-01 09:10 +0100
        Re: Long filenames in DOS/Windows and Unix/Linux Helmut Waitzmann <nn.throttle@xoxy.net> - 2024-09-01 19:51 +0200
        Putting arbitrary characters into the shell command line (was: Long filenames in DOS/Windows and Unix/Linux) Helmut Waitzmann <nn.throttle@xoxy.net> - 2024-09-01 21:07 +0200
        Re: Long filenames in DOS/Windows and Unix/Linux Wayne <wayne@nospam.invalid> - 2024-09-03 13:56 -0400
          Re: Long filenames in DOS/Windows and Unix/Linux Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-03 21:54 +0000
        Re: Long filenames in DOS/Windows and Unix/Linux Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-09-08 07:24 +0200
      Arbitrary characters in filenames (was: Long filenames in DOS/Windows and Unix/Linux) Helmut Waitzmann <nn.throttle@xoxy.net> - 2024-09-01 20:06 +0200
  Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin) Muttley@dastardlyhq.com - 2024-08-31 08:37 +0000
    Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin) John Ames <commodorejohn@gmail.com> - 2024-09-03 08:44 -0700
      Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin) scott@slp53.sl.home (Scott Lurndal) - 2024-09-03 15:47 +0000
        Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin) Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2024-09-03 15:54 +0000
      Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin) gazelle@shell.xmission.com (Kenny McCormack) - 2024-09-03 16:10 +0000
        Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to Muttley@dastardlyhq.com - 2024-09-04 07:27 +0000
          User surveys (Was: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to) gazelle@shell.xmission.com (Kenny McCormack) - 2024-09-04 11:27 +0000
            Re: User surveys (Was: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to) Muttley@dastardlyhq.com - 2024-09-04 13:12 +0000
      Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin) Kaz Kylheku <643-408-1753@kylheku.com> - 2024-09-03 17:37 +0000
        Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin) John Ames <commodorejohn@gmail.com> - 2024-09-03 11:39 -0700
          Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin) Kaz Kylheku <643-408-1753@kylheku.com> - 2024-09-03 20:11 +0000
            Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin) John Ames <commodorejohn@gmail.com> - 2024-09-03 13:25 -0700
              Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin) scott@slp53.sl.home (Scott Lurndal) - 2024-09-03 20:34 +0000
                Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin) Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-03 21:52 +0000
              Re: Long filenames in DOS/Windows and Unix/Linux Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-09-03 15:16 -0700
                Re: Long filenames in DOS/Windows and Unix/Linux Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-03 22:18 +0000
                Re: Long filenames in DOS/Windows and Unix/Linux scott@slp53.sl.home (Scott Lurndal) - 2024-09-03 22:59 +0000
                Re: Long filenames in DOS/Windows and Unix/Linux Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-09-03 16:10 -0700
                Re: Long filenames in DOS/Windows and Unix/Linux Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-03 23:54 +0000
                Re: Long filenames in DOS/Windows and Unix/Linux Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-09-03 17:27 -0700
                Re: Long filenames in DOS/Windows and Unix/Linux Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-04 00:44 +0000
                Re: Long filenames in DOS/Windows and Unix/Linux Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-09-03 21:36 -0700
                Re: Long filenames in DOS/Windows and Unix/Linux Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-04 07:05 +0000
                Re: Long filenames in DOS/Windows and Unix/Linux Ralf Fassel <ralfixx@gmx.de> - 2024-09-04 11:47 +0200
                Re: Long filenames in DOS/Windows and Unix/Linux Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-09-04 03:44 -0700
                Re: Long filenames in DOS/Windows and Unix/Linux Nuno Silva <nunojsilva@invalid.invalid> - 2024-09-04 13:33 +0100
                Always use "--" (Was: Long filenames in DOS/Windows and Unix/Linux) gazelle@shell.xmission.com (Kenny McCormack) - 2024-09-04 13:04 +0000
                Re: Always use "--" (Was: Long filenames in DOS/Windows and Unix/Linux) Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2024-09-04 13:17 +0000
                Re: Always use "--" (Was: Long filenames in DOS/Windows and Unix/Linux) Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-04 21:35 +0000
                Re: Always use "--" (Was: Long filenames in DOS/Windows and Unix/Linux) Kaz Kylheku <643-408-1753@kylheku.com> - 2024-09-05 02:29 +0000
                Re: Always use "--" (Was: Long filenames in DOS/Windows and Unix/Linux) Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2024-09-05 14:48 +0000
                Re: Long filenames in DOS/Windows and Unix/Linux Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-09-03 17:35 -0700
                Re: Long filenames in DOS/Windows and Unix/Linux Kaz Kylheku <643-408-1753@kylheku.com> - 2024-09-03 23:15 +0000
                Re: Long filenames in DOS/Windows and Unix/Linux Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-09-03 16:38 -0700
                Re: Long filenames in DOS/Windows and Unix/Linux Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-03 23:56 +0000
                Re: Long filenames in DOS/Windows and Unix/Linux Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-09-03 17:19 -0700
                Re: Long filenames in DOS/Windows and Unix/Linux Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-04 00:41 +0000
                Re: Long filenames in DOS/Windows and Unix/Linux Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-09-03 21:29 -0700
                Re: Long filenames in DOS/Windows and Unix/Linux Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-04 06:49 +0000
                Re: Long filenames in DOS/Windows and Unix/Linux Nuno Silva <nunojsilva@invalid.invalid> - 2024-09-04 10:16 +0100
                Re: Long filenames in DOS/Windows and Unix/Linux Kaz Kylheku <643-408-1753@kylheku.com> - 2024-09-04 14:30 +0000
                Re: Long filenames in DOS/Windows and Unix/Linux John Ames <commodorejohn@gmail.com> - 2024-09-04 08:41 -0700
                Re: Long filenames in DOS/Windows and Unix/Linux Muttley@dastardlyhq.com - 2024-09-04 15:57 +0000
                Re: Long filenames in DOS/Windows and Unix/Linux Richard Kettlewell <invalid@invalid.invalid> - 2024-09-04 18:03 +0100
                Re: Long filenames in DOS/Windows and Unix/Linux Ralf Fassel <ralfixx@gmx.de> - 2024-09-05 11:29 +0200
                Re: Long filenames in DOS/Windows and Unix/Linux Richard Kettlewell <invalid@invalid.invalid> - 2024-09-05 18:21 +0100
                Re: Long filenames in DOS/Windows and Unix/Linux candycanearter07 <candycanearter07@candycanearter07.nomail.afraid> - 2024-09-07 18:20 +0000
                Word splitting oddities (Was: Long filenames in DOS/Windows and Unix/Linux) gazelle@shell.xmission.com (Kenny McCormack) - 2024-09-07 21:51 +0000
                Re: Long filenames in DOS/Windows and Unix/Linux Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-09-10 07:17 +0200
          Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-09-10 06:51 +0200
      Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to Muttley@dastardlyhq.com - 2024-09-04 07:31 +0000
  Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin) Marcel Mueller <news.5.maazl@spamgourmet.org> - 2024-09-01 11:44 +0200

csiph-web