Making Your Web Applications Platform Independant
I was looking for some information the other day about line separators across Windows/MAC/Linux etc when I stumbled upon 3 great articles from Christian Cantrell.
Although the articles are quite old they were very informative for me so I thought I’d share them in case others didn’t know this already.
Making Your ColdFusion Applications More Platform Independent (Part I) Basically about case sensitive filenames which is very important on *nix, but also included the following which I’ve never heard and to be honest would like to test:
Additionally, make sure you use all lowercase when naming your components. ColdFusion MX will automatically lower-case your component names, which you would never notice on Windows, however on Unix, it will become apparent very quickly when you start getting errors that your components do not exist.
Making Your ColdFusion Applications More Platform Independent (Part II) Shows an automatic way (via Java) to get the current servers file path separator (either a ‘/’ or ‘'), OS dependant.
Making Your ColdFusion Applications More Platform Independent (Part III) I’ve been annoyed many times with the whole chr(10)chr(13) on Windows vs chr(10) on a Mac etc, another automated way to get the server OS ‘line separator’ via Java.
Here are the line and file separators as functions which I’ve also added to my Utils.cfc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19