Issue 30692 - Starbasic runtime function ChDir(<string>) not working
Summary: Starbasic runtime function ChDir(<string>) not working
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P3 Trivial
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
: 61164 69663 103886 (view as issue list)
Depends on:
Blocks: 61015 61019
  Show dependency tree
Reported: 2004-06-24 15:00 UTC by christianjunker
Modified: 2017-05-20 11:28 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Note You need to log in before you can comment on or make changes to this issue.
Description christianjunker 2004-06-24 15:00:37 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.
Comment 1 stephan.wunderlich 2004-07-06 14:14:27 UTC
SW->AB: basic-runtime, seems to be yours
Comment 2 stephan.wunderlich 2004-07-06 14:18:44 UTC
set target
Comment 3 stephan.wunderlich 2004-07-06 17:37:55 UTC
changed owner
Comment 4 ab 2005-05-03 12:53:52 UTC
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")
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.

Comment 5 christianjunker 2005-08-19 00:44:14 UTC
Cannot look into Online help right now, but this definately needs to get mentioned there (that ChDir and 
CurDir are broken).

Comment 6 Uwe Fischer 2006-01-23 10:35:56 UTC
Why did no one bother to set the documentation department to cc then???
Now we know thanks to the OOo german help review project.
Comment 7 ab 2006-03-31 09:46:24 UTC
Also applies to ChDrive
Comment 8 ab 2006-03-31 09:46:37 UTC
*** Issue 61164 has been marked as a duplicate of this issue. ***
Comment 9 ab 2006-09-19 08:39:59 UTC
*** Issue 69663 has been marked as a duplicate of this issue. ***
Comment 10 Uwe Fischer 2006-09-19 10:29:53 UTC
inserted warnings to the help files sbasic/shared/03020401.xhp,03020402.xhp,
03020403.xhp, in CWS hcshared05
Comment 11 kpalagin 2008-02-27 23:54:24 UTC
So could this 4 year old issue be finally dealt with?
Comment 12 lohmaier 2010-06-15 12:47:36 UTC
*** Issue 103886 has been marked as a duplicate of this issue. ***
Comment 13 Christopher Yeleighton 2012-03-05 11:44:54 UTC
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).
Comment 14 Marcus 2017-05-20 11:28:00 UTC
Reset assigne to the default "".