Anecdote about how oddball file names can bite you later on, in ways you maybe didn’t expect.
TRUE STORY.
A certain grocery wholesaler produces data files with product pricing information, to be downloaded by retailers (supermarkets) and imported into their cash register POS systems. There are three to eight such files each week, with longish names.
Those POS systems in the store are a cash register application, written by a small company where I used to work. This POS system is capable or running add-on modules written in a home-grown scripting language. I am fluent in that scripting language. Now I do 3rd-party consulting for a dealer (re-seller) who traffics in this POS app.
So I write an add-on script for the store manager to run, that will automate this. It consults a config file, from which it gets a list of the files to be downloaded and the local names they are to be given (since the POS app only groks old-style DOS 8.3 names). My script does these steps, basically:
– Consult the config file to get the list of name and other details of the job (like the name of the FTP site and the user-name to work with.)
– Writes DOS batch file (which it will soon run) that will, in turn, run FTP
– Writes a FTP script that FTP will run to connect to the FTP site and get those files.
– Then runs COMMAND.COM, directing it to run that DOS batch file.
– The DOS batch file, in turn, runs FTP and gives it the FTP script for its input.
This worked fine for years. Then one day, the client calls to tell me it isn’t working right.
Took a while to figure out (all this is done long distance, via verbal phone conversations). Turns out, the wholesaler added several new files to the collection to be downloaded. These new files have longer names than the earlier files, and they have spaces in them. Why? Because the wholesaler has no idea how their customers might be downloading these files, and it never occurs to them that somebody somewhere might have a problems with it!
Turns out that the file names with spaces, which I just write verbatim into the FTP script, don’t work. The FTP program treats the spaces as word separators and won’t recognize names with spaces.
The resolution? Good thing that I am in a position to modify that add-on module (since I wrote it). I modified it so that it always writes the file names into the FTP script with quotes around them. Fortunately, FTP can work with this. (For the names that don’t have spaces in them, it still never hurts to put quotes around them.)
Moral of the story: Don’t use file names with spaces, dots, or other odd-ball punctuation. You never can predict how it will be used someday later, or what problems will happen.