FileOps.$changeworkingdir()

Function groupExecute on clientPlatform(s)
FileOpsNOAll

Syntax

FileOps.$changeworkingdir(cPath)

Description

Changes the current working directory to the directory named in cPath.

$changeworkingdir() only switches between directories on the same drive, not between drives. The function returns an error code, or zero if successful: see the FileOps function error codes.

Note: Applications on macOS do not have a working directory. If you use this function on macOS, it returns the error code kFileOpsNoOperation.

Example

Switch
 
platform(
()

  
Case
 
'X'
 
## for Mac OSX

    
Quit method
 
 
## working directories not supported

  
Case
 
'U'
 
## for Linux

    
Do
 
FileOps
.
$changeworkingdir
(
'/omnis/examples'
)
 
Returns 
lError

  
Default
 
## for Windows platforms

    
Do
 
FileOps
.
$changeworkingdir
(
'c:\omnis\examples'
)
 
Returns 
lError

End Switch
OK message
 
{
Working directory is now: [
FileOps
.
$getworkingdir
()]
}