I'm writing a program for Mac OS X that allows the user to drag a row from a list in the application to Finder, where it automatically exports the data represented by the row to a file named after the row's display name (which must be able to contain almost any Unicode character). The user can edit this display name in the application, and it places no restrictions on this name for its internal use, but obviously I need to strip : and / from individual path components on OS X.

This program only runs on OS X, but in theory someone could write a similar program on another OS and want to import these files, or the user could be trying to export to a FAT32 or NTFS filesystem.

How far should I go?

  • Strip / replace leading . characters to avoid a hidden file?
  • Strip characters like \ or < which may not be valid on the target filesystem?
  • Fix up names that might confuse OS X tools, like -rf *?
  • Fix up names that might confuse non-OS X tools, like con?

Is this worth a preemptive pop-up dialog full of text about filename compatibility? Or should I punt and show the user the error the OS gives me when I try to open the file?

1 Answer 1


If there is a potential future usability problem for a user, and an easy solution now, you should solve it now.

I would present a dialogue letting the user know that the file name that will be generated needs to be modified slightly because it contains characters that may cause compatibility issues.

Then show them what the file name will be, and give them the option to accept the modified name or choose their own name for the file.

  • It's not possible to rename the row (it must match another name I have no control over), only the filename.
    – user9739
    Commented Mar 7, 2013 at 11:39
  • @JoeWreschnig Please add that information to your question, and I will edit my answer accordingly.
    – JohnGB
    Commented Mar 7, 2013 at 11:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.