Wel, I got a lot of things working with it, but for some reason, it refuses to get the information from files or directories with a space in between.
The following command :
ls -l "/some/dir/AC Seven Yearmix 2004.mp3"
would provide me hte proper info, as the quotes take care of the spaces.
If I try to implement this in the Runtime.exec() I get nothing.
Runtime.getRuntime().exec( "ls -l \"/some/dir/AC Seven Yearmix 2004.mp3\"" ).getImputStream();
gives an empty string after reading all its bytes.
Reason: for some unknown reason, the exec method considers Seven, Yearmix etc as other arguments and as such the command of course cannot find the file
if there some way to escape a space or to replace it with some ascii character to make sure it is preserved as one string?
edit: found it.
if I do a myFile.getName().replace(' ', (char) Character.DIRECTIONALITY_WHITESPACE)
it is fixed
[ October 28, 2005: Message edited by: Dieter Merlin ]