Subject: [netatalk-admins] Re:Netatalk and control characters

From: [email-masked]
Date: Thu, 7 May 1998 09:36:41 +0100

>Those forms cannot be used further in a shell script (at least, not
without
>big problems and changing everything that works now). Just try to get
#foreach
>f in "`find Š| grep something`"# (you understand what I mean) to work.

I've been down this road, and I think it is resolvable. For instance, in
the above
scenario you need to make sure that subsequent references to $f are
enclosed in ""
to make sure that the shell doesn't see the control characters. I've had a
lot of
experience with the problem with filenames with embedded spaces. Perl in
particular
is a  bitch with this as it deliberately strips leading and trailing
whitespace from a filename argument passed to the open function. I say that
"I think it is resolvable" because I know that the "$f" trick works with
filenames with embedded spaces, but I've haven't had to deal with embedded
control characters.
BTW there is a very strong case for saying that any shell script which
deals with files on a filesystem, and which cannot handle names which are
legal on that filesystem, is broken, notwithstanding the fact that it may
rarely if ever see such filenames.

>I still think that control characters should be mapped too. PC Exchange
>does so, by the way ("icon%0d" via Dave/Samba).
So change it - you have the source, and it can't be that difficult to
modify the range of characters which are mapped. In fact, you should change
it, make it a compile time option, and give the diffs back to the
community. :-)

>And now that we are on the topic, netatalk should "strip" "some"
extensions
>before presenting a filename to the Mac (and add them from the
AppleVolumes
>files). We would "win" 4 characters for a filename most of the time. "A
>Document.doc" is fine for the unix side, and needed for samba users, but
>I'd like to see it as "A Document".

And if you had two files called "A Document" and "A Document.doc" what
would you like to see ?

Kindest regards,

Niall  O Broin

UNIX Network Administrator               Ground Systems Engineering
Department
European Space Operations Centre         [email-masked]
Darmstadt, Germany                 Ph./Fax  +49 6151 90 3619/2179

---

From: Jan Dockx <[email-masked]>
Date: Thu, 7 May 1998 10:48:52 +0200

>rarely if ever see such filenames.

Agreed. But there is such a thing as "reality". ;-)

>From Andras Kadinger:
=====
 Try this; this adds converting char code 13, that is, ^M. Untested, but
very simple and straightforward.

Hope, this helps,

Sincerely,
Andras Kadinger
[email-masked]

--- etc/afpd/desktop.c.orig      Thu May  7 01:13:47 1998
+++ etc/afpd/desktop.c   Thu May  7 01:14:43 1998
@@ -532,7 +532,7 @@
     m = mpath;
     u = upath;
     while ( *m != '\0' ) {
-       if ( !isascii( *m ) || *m == '/' || ( i == 0 && *m == '.' )) {
+       if ( !isascii( *m ) || *m == '/' || ( i == 0 && *m == '.' ) ||
*m == 13) {
            *u++ = ':';
            *u++ = hexdig[ ( *m & 0xf0 ) >> 4 ];
            *u++ = hexdig[ *m & 0x0f ];
=======

>And if you had two files called "A Document" and "A Document.doc" what

Same difference with netatalk cutting very long file names to 31 chars.

Jan Dockx - assistent               ([email-masked])
K.U.Leuven, Department of Computer Science
Celestijnenlaan 200 A 03.28; 3001 Heverlee; Belgium
tel.: ++ 32/16/32 76 56                   fax.: ++ 32/16/32 79 96
<http://www.cs.kuleuven.ac.be/~jand/>
+---------------------------------------------------------------+
  "There's some joke making around about some mathematician
   that said that 1000 chimpansees in 1000 years sitting at
   1000 typewriters would eventually write the works of
   Shakespeare. And the snap around the joke is that the Web
   proves this is not so."
                                Kurt Vonnegut about the Internet
                                in "Vonnegut's Timequake; All
                                Things Considered, September 22,
                                1997; National Public Radio"