Bryan F. Hogan
Thu, 14 Aug 2003 12:49:26 -0700
Well I don't know about Macromedia, but 7 lines is better than 16 for me.
<cfscript>
if(Server.OS.Name contains 'Windows') {
localVars.pathSep='\';
} else {
localVars.pathSep='/';
}
</cfscript>
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Steven Erat Sent: Tuesday, August 12, 2003 1:16 PM To: '[EMAIL PROTECTED]' Subject: [CFXML_Blog] Linux/Windows source tree (was RE: CFXML_blog on SourceForge) There only needs to be one source for all platforms, not one source tree per OS. The Macromedia XML News Aggregator uses this function to determine the correct directory delimiter for the current OS: ---------------------------------------------------------------------------- <cfscript> function getFileSeparator() // this will switch betwixt *nix and Windows { var fileObj = ""; if (isDefined("application._fileSeparator")) { return application._fileSeparator; } else { fileObj = createObject("java", "java.io.File"); application._fileSeparator = fileObj.separator; return getFileSeparator(); } } </cfscript> ---------------------------------------------------------------------------- <cfoutput>#getFileSeparator()#</cfoutput> ---------------------------------------------------------------------------- Otherwise, case sensitivity should be the only other concern for a single *nix/Windows source tree. -Steven Erat