Skip to content

rajula96reddy/pharo-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 

Repository files navigation

pharo-cli

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

  1. Open iceberg.
  2. Clone this repository by clicking on clone repository.
  3. 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

  1. Why getcwd() instead of environment variables
    1. mikeizbicki/ucr-cs100#1088
    2. https://vineetreddy.wordpress.com/2017/05/17/pwd-vs-getcwd/
  2. The function getcwd() and buffer size
    1. https://www.gnu.org/software/libc/manual/html_node/Working-Directory.html
    2. https://msdn.microsoft.com/en-us/library/sf98bd4y.aspx
  3. Problems with PATHMAX
    1. http://insanecoding.blogspot.fr/2007/11/pathmax-simply-isnt.html

 

Feel free to create an issue, if this isn`t working.

About

Enhancements to pharo command line interface

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published