Mercurial > hg > octave-lyh
changeset 2196:0dff6c159542
[project @ 1996-05-14 08:58:40 by jwe]
author | jwe |
---|---|
date | Tue, 14 May 1996 08:59:24 +0000 |
parents | 79595bdfdb1f |
children | 680ce730f0c6 |
files | src/dirfns.cc |
diffstat | 1 files changed, 28 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/dirfns.cc +++ b/src/dirfns.cc @@ -72,6 +72,9 @@ #include "utils.h" #include "variables.h" +// The current working directory. +static string Vcurrent_directory; + // Non-zero means follow symbolic links that point to directories just // as if they are real directories. static int follow_symbolic_links = 1; @@ -580,6 +583,31 @@ return retval; } +static int +pwd (void) +{ + int status = 0; + + string s = builtin_string_variable ("PWD"); + + if (s.empty ()) + { + gripe_invalid_value_specified ("PWD"); + status = -1; + } + else + Vcurrent_directory = s; + + return status; +} + +void +symbols_of_dirfns (void) +{ + DEFCONST (PWD, get_working_directory ("initialize_globals"), 0, pwd, + "current working directory"); +} + /* ;;; Local Variables: *** ;;; mode: C++ ***