This repository aims at improving the Pharo Command Line Interface. The current working is about getting the 'Current Working' from the pharo IDE itself. This is a generic method and works for both linux and Windows. Support for OSX will be added soon.
Loading the class:
The easiest way to load the class is using Iceberg. Install iceberg as mentioned in the link. Or iceberg is built in the latest Pharo 6.0 image.
- Open iceberg.
- Clone this repository by clicking on clone repository.
- And load the package in the repository.
Usage:
To get the current working directory, do OSPlatform current currentWorkingDirectoryPath
This will give the current working directory i.e where the current working image is located. This is will take the default buffer size as set by the method defaultMaximumPathLength
To get the current working directory with a difinite buffer size, do OSPlatform current currentWorkingDirectoryPathWithBufferSize: size
This will give the current working directory with the size passed as buffer size for the method. If the buffer size is not sufficient or if it is less than the path size, the method returns 'nil'.
References used for the implementation
- Why getcwd() instead of environment variables
- The function getcwd() and buffer size
- Problems with PATHMAX
Feel free to create an issue, if this isn`t working.