Discussion:
[BitPim-devel] Fw: Re: [BitPim-user] RE: filename error
Joe Pham
2005-05-09 02:39:20 UTC
Permalink
Any suggestion on a logic to fix this?

-Joe Pham

---------- Forwarded Message ----------
IOError: [Errno 2] No such file or directory: u'C:\\Documents and
Settings\\Brian Sheehan\\My
Documents\\bitpim\\ringer\\*kidnapper_warning*_voice_r.mid'
BitPim stores the file on your hard disk with the same name as it has
on the phone. In this case, the asterisk characters are not allowed as
part of filenames by Windows.

We will eventually get around to fixing this, by storing the filenames
on disk differently than on the phone.

Roger



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
BitPim-user mailing list BitPim-***@lists.sourceforge.net
Unsubscribe or change options at
https://lists.sourceforge.net/lists/listinfo/bitpim-user

There are several hundred people on this list. Please be
courteous, on topic and follow the instructions before posting
http://bitpim.sf.net/testhelp/support.htm


______________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/month -visit http://www.netzero.com/surf to sign up today!
Roger Binns
2005-05-09 05:45:20 UTC
Permalink
Post by Joe Pham
Any suggestion on a logic to fix this?
The easiest way is to encode "bad" characters. For example we
could use the standard web scheme and use % followed by two
hex digits.

Since filenames are bytes on the phone, we'll need to preserve
bytes on the filesystem, especially those filesystems that support
unicode and various other encodings.

So % encoding the following should do the trick:

- % itself
- all bytes less than 32 or more than 127
- / (Unix)
- / : (Mac)
- / \ [ ] ? * : " < > | = ; (Windows)

This will screw up anyone who already has % in a filename after
the version that introduces the fix, but there isn't really any
other way.

Another alternative is to go the whole hog and base64 encode the
entire filename. That then means we have to supply an intermediate
temporary file for things like dragging out.

Roger

Loading...