Windows file paths on *nix systems
December 4, 2008 . Posted in tutorial.
Yesterday I amused myself when I re-discovered that I had to deploy a web application that was pointing to external files using windows style absolute paths rather than relative paths.
Imagine this scenario:
1. You are running a *nix system. Mac OS, Linux (Ubuntu) etc
2. You have an existing web application that references some sort of external resource (e.g. logging configuration file), but the path to this resource is windows style. e.g. C:/logging/config.xml
3. This web application used to run just fine on a server running on Windows (e.g. JBoss) but now that you have deployed it to your new OS the path no longer makes sense…
You have three choices:
1. bitch at those who used absolute paths in the web application and ask them to fix it.
2. change the web application to reference some sort of relative path
3. WOW: create a c: folder in your JBoss bin folder.
I kid you not! This is actually possible… funny as hell, but still possible.
If you are on Mac OS, the trick is to create the c: folder from the Terminal rather than Finder. Finder will not allow ":" in the name of a folder. So fire up terminal, cd to the JBoss/bin folder and run :
>mkdir c:
Now copy into this folder the resources that you need. e.g. logging/config.xml and you are ready to go.
Let me know if this worked on your OS.
Cheers…
Tagged: iPhone
Post a comment