Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #44931

Re: Making safe file names

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <davea@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.042
X-Spam-Evidence '*H*': 0.92; '*S*': 0.00; 'ignored': 0.07; 'subject:file': 0.07; 'tom': 0.07; 'locale': 0.09; 'windows': 0.15; 'encodings': 0.16; 'happily': 0.16; 'prefixed': 0.16; 'ignore': 0.16; 'wrote:': 0.18; 'settings': 0.22; 'header:User- Agent:1': 0.23; 'unicode': 0.24; 'versions': 0.24; 'switch': 0.26; 'certain': 0.27; 'header:In-Reply-To:1': 0.27; 'character': 0.29; "doesn't": 0.30; 'andrew': 0.30; 'characters': 0.30; '(which': 0.31; 'url:wiki': 0.31; 'url:wikipedia': 0.31; 'file': 0.32; 'probably': 0.32; "we're": 0.32; 'device': 0.34; 'trouble': 0.34; 'but': 0.35; 'there': 0.35; 'largely': 0.36; 'url:support': 0.36; 'url:org': 0.36; 'url:microsoft': 0.37; 'to:addr:python-list': 0.38; 'issue': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'system.': 0.39; 'most': 0.60; 'tell': 0.60; 'first': 0.61; 'name': 0.63; 'such': 0.63; 'received:74.208': 0.68; 'url:%1': 0.72; 'received:74.208.4.194': 0.84; 'subject:Making': 0.84; 'unclear': 0.84
Date Tue, 07 May 2013 21:45:08 -0400
From Dave Angel <davea@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5
MIME-Version 1.0
To python-list@python.org
Subject Re: Making safe file names
References <51895D03.4000300@gmail.com> <518998FE.6030805@davea.name> <mailman.1430.1367974288.3114.python-list@python.org> <Lvydneajg7LXNhTMnZ2dnUVZ_rKdnZ2d@westnet.com.au>
In-Reply-To <Lvydneajg7LXNhTMnZ2dnUVZ_rKdnZ2d@westnet.com.au>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Provags-ID V02:K0:9eiQ5PbeWvW+xPTlF/a6fiKrJQ0qGt2W8Yi3xFtnX4c o0Sh9Hzfk9P2f88EqJjDpTlvGhavwV3Qqmn+wwr48fwKDaSfLU RaCc9HmVwqm6wXWOhs92gpApW9ioP5n1bdT0DjMKtsLV785eTq b6rDDHJu3jyLq1/HOf+sBTUdEgNtKpxT10/yE0bG+2E9Knskdv M17KoFHunjzB6+aji2AeSNGXN9LQv8tHzwuq4zb4r9L0wceZf/ 9RpfKrRRaLAeYtF1ToKllzs+iPQdoDhG+NpDfS035I8W+v8iSh n8yZSDU3V1bdEu08+U/cEjHyNAHGOQvkVqNG74dA/LX9zmFVw= =
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1435.1367977523.3114.python-list@python.org> (permalink)
Lines 32
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1367977523 news.xs4all.nl 15887 [2001:888:2000:d::a6]:54302
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:44931

Show key headers only | View raw


On 05/07/2013 09:28 PM, Neil Hodgson wrote:
> Andrew Berg:
>
>> This is not a Unicode issue since (modern) file systems will happily
>> accept it. The issue is that certain characters (which are ASCII) are
>> not allowed on some file systems:
>>   \ / : * ? "<  >  | @ and the NUL character
>> The first 9 are not allowed on NTFS, the @ is not allowed on ext3cow,
>> and NUL and / are not allowed on pretty much any file system. Locale
>> settings and encodings aside, these 11 characters will need to be
>> escaped.
>
>     There's also the Windows device name hole. There may be trouble with
> artists named 'COM4', 'CLOCK$', 'Con', or similar.
>

In MSDOS 2, there was a switch that would tell the OS to ignore such 
names unless they were prefixed by \DEV.  But like the switchar switch, 
it was largely ignored by the ignorant, and probably doesn't exist in 
current versions of M$OS

> http://support.microsoft.com/kb/74496
> http://en.wikipedia.org/wiki/Nul_%28band%29
>
>     Neil

While we're looking for trouble, there's also case insensitivity. 
Unclear if the user cares, but tom and TOM are the same file in most 
configurations of NT.

-- 
DaveA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Making safe file names Andrew Berg <bahamutzero8825@gmail.com> - 2013-05-07 19:51 -0500
  Re: Making safe file names Neil Hodgson <nhodgson@iinet.net.au> - 2013-05-08 11:28 +1000
    Re: Making safe file names Dave Angel <davea@davea.name> - 2013-05-07 21:45 -0400
      Re: Making safe file names Roy Smith <roy@panix.com> - 2013-05-07 22:21 -0400
    Re: Making safe file names Andrew Berg <bahamutzero8825@gmail.com> - 2013-05-07 21:20 -0500
    Re: Making safe file names Andrew Berg <bahamutzero8825@gmail.com> - 2013-05-07 21:06 -0500
    Re: Making safe file names Dave Angel <davea@davea.name> - 2013-05-08 00:10 -0400
    Re: Making safe file names albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-05-28 13:44 +0000
      Re: Making safe file names Chris Angelico <rosuav@gmail.com> - 2013-05-28 23:53 +1000
      Re: Making safe file names Grant Edwards <invalid@invalid.invalid> - 2013-05-28 16:03 +0000
  Re: Making safe file names Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-08 03:40 +0000
    Re: Making safe file names Dave Angel <davea@davea.name> - 2013-05-08 00:13 -0400
      Re: Making safe file names Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-08 04:47 +0000
    Re: Making safe file names Andrew Berg <bahamutzero8825@gmail.com> - 2013-05-07 23:49 -0500

csiph-web