currentdir - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


currentdir

queries and/or sets the current working directory

 

Calling Sequence

Parameters

Description

Details

Examples

Calling Sequence

currentdir()

currentdir(target)

Parameters

target

-

string or symbol; directory to be set as current directory

Description

• 

If called with no arguments, currentdir returns the current working directory as a Maple string.

• 

If called with one argument target, currentdir sets the current working directory to the specified directory.  The currentdir command returns the previous working directory as a Maple string.

• 

If a specified directory does not exist, or cannot be accessed for some other reason, currentdir will generate an error.

• 

If target is a string; it is interpreted as be a path to the new directory.

• 

If target is one of the symbols bindir, datadir, homedir, mapledir, toolboxdir, or worksheetdir it is interpreted as referring to the directory specified by the associated kernelopts or interface variable. For example, currentdir(homedir) sets the current directory to the directory returned by kernelopts(homedir).

Details

• 

The set of characters that are permitted in directory names is system dependent. Likewise, the character used to separate the components of a directory is system dependent. If the backslash character is to appear in the string, it must be doubled up, since Maple strings use the backslash character as an escape character.

• 

Changing the current directory does not affect library paths that were specified in a relative way on the Maple command line; all such library paths become fully qualified, that is, absolute when Maple starts. However, library paths specified subsequently (that is, by assignment to libname) may become invalid if they were relative, and the current directory is later changed.

• 

The current directory is restored to the value it had at the beginning of the session after the restart command.

• 

If system calls are disabled, currentdir will return an error if the current working directory isn't in the secure read list.

Current Directory Indicator in Standard Interface

• 

In the Maple Standard interface, the current directory is indicated in the status bar at the bottom of the Maple window.

• 

This indicator is a live control.  To set a new current working directory interactively through the Maple Standard interface:

1. 

Click the current directory indicator on the status bar.

2. 

Navigate to the desired new directory.

• 

For more information on the status bar, see Status Bar.

Examples

OldDirectorycurrentdir

OldDirectory/u/joeuser/work

(1)

currentdirhomedir

/u/joeuser/work

(2)

currentdir

/u/joeuser

(3)

currentdirOldDirectory

/u/joeuser

(4)

currentdir

/u/joeuser/work

(5)

See Also

getenv

interface

kernelopts

libname

mkdir

restart

rmdir

worksheet/reference/statusline