Madhur Kashyap wrote: > Hi, > > My calc application has users on both Windows and linux. The application > deals with loading of files from disk and hence the manner in which I > construct the path strings should be portable. I am avid user of TCL and it > supports a command namely "file join" "file dirname" "file tail" etc. > > Do we have similar commands in OO Basic? If not natively, has some one > written those commands and willing to share? It will save some effort at my > end. > > Also, I am not able to find out a neat way to identify the operating system > I am operating on. I am using Environ runtime command to poll OS and OSTYPE > variables.
As you are not able to identify the OS your task can be solved only if the file location can be specified relative to a portable location like e.g. the "home" folder (this would be "My Documents on Windows, /home/username on Linux). You can use a service in OOo to get the absolute file URL of the home folder at runtime and add the relative path to this URL (please note that in URLs only slashes are used, no back slashes!). If the files are placed anywhere in the file system it is impossible to locate them in a platform independent way. So if you want to have some more tips, please describe where the files are located for the different platforms. Regards, Mathias --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
