Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 May 2011 19:53:14 +0200
From:      "C. P. Ghost" <cpghost@cordula.ws>
To:        Modulok <modulok@gmail.com>
Cc:        Frank Bonnet <f.bonnet@esiee.fr>, freebsd-questions@freebsd.org
Subject:   Re: Filename containing French characters ?
Message-ID:  <BANLkTi=uXYFnOVfxixFAaRQYjcugbA17Rg@mail.gmail.com>
In-Reply-To: <BANLkTikEMQBm0743qaRsw-d%2B0RtWFxwEjw@mail.gmail.com>
References:  <990E8670-2137-4F80-8D9D-BCEB05C6ECAA@esiee.fr> <BANLkTikEMQBm0743qaRsw-d%2B0RtWFxwEjw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, May 23, 2011 at 5:50 PM, Modulok <modulok@gmail.com> wrote:
> Short answer, use a glob pattern. Assume I have a file named '=E0 fichier=
.txt':

(...)

Very good hints indeed.

I once had a directory full of files with strange characters, so I wrote a
little program that replaced every non-ascii char in a filename with its
hex-encoding (like this: "Hello%20World%21", % escape char), so
I could manipulate them with the shell. As long as the expanded
filenames didn't hit the MAXNAMELEN limit in <sys/dirent.h>, it
worked perfectly.

I could dig this C program out of old archives, but I guess that it is
faster to rewrite it on the fly, or even script it with sh(1), tr(1), awk(1=
),
and find(1)... ;-)

Alternatively to such a run-once-in-a-while program, I could also
imagine a file system layer on top of existing file systems that
would do this conversion automatically, but that's harder to code,
and harder to debug (kernel mode!).

-cpghost.

--=20
Cordula's Web. http://www.cordula.ws/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTi=uXYFnOVfxixFAaRQYjcugbA17Rg>