Apache OpenOffice (AOO) Bugzilla – Issue 30692
Starbasic runtime function ChDir(<string>) not working
Last modified: 2017-05-20 11:28:00 UTC
Hello, changing the current working directory with the runtime function ChDir in the Basic IDE has no effect on the current directory and is even not really inspected by the Interpreter, for example.. ChDir("KJDHDHDKJDHKJD:\") leads to no error, although it's an invalid drive. Tested on Windows 2000 and Linux for version 1.1.0, 1.1.1, 1.1.2 and the snapshot build for 2.0 with everytime the same misbehavior. I couldn't find the "scripting" component, so I posted it into the API section.
SW->AB: basic-runtime, seems to be yours
set target
changed owner
This issue has two Star Office internal duplicates. I use this issue to combine all three: ======================================== From internal task 109967, Submit Date: 2003-05-28 Description: mkdir("c:\a") chdir("c:\a") msgbox curdir() The above code does not display "c:\a". It is not clear if this is a chdir() or curdir() problem, but the mkdir() function works fine. - Seen on W2K, W98, and Solaris. KK: I don't know if this is the expected behavior of CurDir() and ChDir(), but as far as I can gather from the help, it looks like a bug. CN: seems to be that chdir() does not work. chrid("sdfsdf") does not throw error code 76 as described in Help. ======================================== From internal task 116955, Submit Date: 2004-05-28 CurDir works correctly and shows that ChDir has no effect. Even though a file/path literal may be platform-specific, there is no reason why ChDir should not accept both file URLs and platform-specific paths. AB -> CS: I don't know why you assume that this is the (only) problem concerning ChDir. This task is not so easy. According to the VB docu- mentation this command sets the working directory for the current pro- cess. So e.g. external processes started with shell should be started in this directory then. Unless I wrote platform specific code which I real- ly want to avoid I would need an corresponding SAL API for setting this directory. Besides the question how this can be realised platform independent I'm not sure if the Office itself tolerates the change of the current directory. Another way of course would be to simulate the ChDir/CurDir functionality inside Basic only, but I don't know how much sense this makes. ======================================== Set to STARTED for now, but in general this is a probable candidate for WONTFIX as I don't have an idea how to solve the general problem described above.
cyb->ab: Cannot look into Online help right now, but this definately needs to get mentioned there (that ChDir and CurDir are broken).
Why did no one bother to set the documentation department to cc then??? Now we know thanks to the OOo german help review project.
Also applies to ChDrive
*** Issue 61164 has been marked as a duplicate of this issue. ***
*** Issue 69663 has been marked as a duplicate of this issue. ***
inserted warnings to the help files sbasic/shared/03020401.xhp,03020402.xhp, 03020403.xhp, in CWS hcshared05
So could this 4 year old issue be finally dealt with?
*** Issue 103886 has been marked as a duplicate of this issue. ***
For me, CURDIR$ always returns the path to my documents, regardless how I start LibreOffice, and OPEN always interprets the file path relative to CURDIR$ (which should be noted in the description of OPEN).
Reset assigne to the default "issues@openoffice.apache.org".