Dealing with e-mail attachments with names containing spaces.

Genes MailLists lists at
Tue Apr 26 14:57:59 UTC 2011

On 04/26/2011 10:23 AM, Aaron Konstam wrote:
> If you get an e-mail whose attachment has spaces in its name one has
> problems dealing with the attachment in Linux. I found a way to deal
> with them (such as open a pdf file attachment) but I wonder is anyone
> has a more coherent way to deal with them than I have found.
> My way is somewhat hoakie. I am using evolution to read mail.

  I use thunderbird - and never had a problem saving, reading or whatever.

  However, once weird they are saved to disk, I find it annoying to have
'odd' filenames with spaces, punctuation etc - so I wrote a small
c-program to rename the files to something more sensible.

     filenameclean <list of files>

     Fixes the list of files, or with no args it does all files in the
current directory. The rules are in the c-code and pretty obvious.
Normal filenames are left alone - it only renames odd filenames.

     In the event a renamed file already exists - the program will warn
you and do nothing.

  This is the program I use (attaching small c code - hope thats ok).

  makefile is just

  default: filenameclean

  filenameclean: filenameclean.c
  	cc -o filenameclean filenameclean.c


-------------- next part --------------
A non-text attachment was scrubbed...
Name: filenameclean.c
Type: text/x-csrc
Size: 2754 bytes
Desc: not available
Url : 

More information about the users mailing list