I am writing a mac program that among other things, allows a user to create unix links to files. Now I am using the runtime.exec() method to run the ls -s command e.g.
ls -s dir1/fileName dir2/NewfileName
This works but becomes difficult if the path name to the file has a space. e.g.
ls -s dir 1/fileName dir2/NewfileName
I thought of moving the file to a central temporary directory then making the unix link then moving them back but in Java there is no real way of moving a file rather it is copying and the unix command mv is also at the mercy of paths with spaces.
Are there any suggestions to overcome this?