Anyway to get the chars that are not valid in filenames
Paulo Levi
i30817 at gmail.com
Wed Jul 29 11:42:55 PDT 2009
Yeah, but that is exactly why it would be the responsibility of the
platform to bind that.
If i have to produce filenames from strings of unchangeable input I'd
like to produce something that is not a arbitrary UID.
Nevertheless, now i'm using whitelisting - replace by space anything
not alphanumeric or "-", "&" and "." in the unicode range (canonical
equivalence).
On Wed, Jul 29, 2009 at 4:23 PM, Martin Buchholz<martinrb at google.com> wrote:
> On Tue, Jul 28, 2009 at 16:12, Paulo Levi<i30817 at gmail.com> wrote:
>> In a platform independent manner of course.
>> I sometimes have to convert strings into filenames (and it is
>> important to users to read them yes) and fall afoul of this
>> MSDN Path..::.GetInvalidFileNameChars Method seems like it would work
>> as a windows binding. Anyway in the jdk (1.6) to do this?
>> (and it really should be in the Paths api too).
>
> In the general case, a filesystem could use arbitrary rules
> for which sequence of characters is a valid file name.
> The ScrabbleFileSystem might require that every file name
> is a word from the official Scrabble (TM) dictionary.
>
> Martin
>
More information about the nio-discuss
mailing list