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


Groups > comp.lang.python > #44915

Re: Making safe file names

Date 2013-05-07 18:10 -0500
From Andrew Berg <bahamutzero8825@gmail.com>
Subject Re: Making safe file names
References <51895D03.4000300@gmail.com> <CAA=1kxTnyFgLW=N_7mOCNnj75qDHt8Dfd-aYUYD8deLTrUBQ4g@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1426.1367968585.3114.python-list@python.org> (permalink)

Show all headers | View raw


On 2013.05.07 17:18, Fábio Santos wrote:
> I suggest Base64. b64encode
> (http://docs.python.org/2/library/base64.html#base64.b64encode) and
> b64decode take an argument which allows you to eliminate the pesky "/"
> character. It's reversible and simple.
> 
> More suggestions: how about a hash? Or just use IDs from the database?
None of these would work because I would have no idea which file stores data for which artist without writing code to figure it out. If I
were to end up writing a bug that messed up a few of my cache files and noticed it with a specific artist (e.g., doing a "now playing" and
seeing the wrong tags), I would either have to manually match up the hash or base64 encoding in order to delete just that file so that it
gets regenerated or nuke and regenerate my entire cache.

-- 
CPython 3.3.1 | Windows NT 6.2.9200 / FreeBSD 9.1

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


Thread

Re: Making safe file names Andrew Berg <bahamutzero8825@gmail.com> - 2013-05-07 18:10 -0500

csiph-web