On 2010-03-27 14:20, Madhur Kashyap wrote:
That's completely unnecessary if you use URLs instead of path names. As
most API calls in OOo use URLs anyway you also save your don't need to
convert your file names when you want to use them in API calls.
The biggest problem still is "sRootDir". You have to know this and so
your idea to write OS agnostic code is only possible with using a "root
dir" that is accessible through one of OOo's path variable, like e.g.
the HOME folder. If you are not able to identify the operating system
you are working on, how can you guess "sRootDir" in the correct
notation? OTOH, if you know "sRootDir", you also know at least if your
OS has a Windows type or a Unix type file name notation.
Actually in my description I gave, I did not tell that I also need toexecute some shell
commands with path description. So, does "shell" or
"execute" commands accept URLs ? I haven't tried that but my gut feel is it
would not. So, would the conversion command take care of path separator?
For this particular problem you can just always use '/' as path
separator since it will work on Windows too. Windows has accepted '/' as
a path separator since before year 2000, but it is not a widely known
fact. You can even mix path separators on Windows without ill effects, e.g.
C:\TEMP>notepad c:\temp/out.txt
will start notepad with the c:\temp\out.txt file just fine. Only
potential problem I see with that would be how to add drive letters
correctly - if you use absolute paths anywhere.
Cheers
-- Jan
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]