You can use popen() to run pwd in a shell. It'll give you the same answer as calling getcwd() from within the APL process.
A file's presence can be probed using fstat(). A negative return value denotes the absence of the file. popen() and fstat() are already exposed via lib_file_io. Take a look at my package manager code for examples. See pkg⍙sh and pkg⍙file_info. ---------- Forwarded message ---------- > From: Blake McBride <[email protected]> > To: "[email protected]" <[email protected]> > Cc: > Date: Mon, 14 Jul 2014 06:21:37 -0500 > Subject: [Bug-apl] Additions to FILE_IO > Greetings, > > It would be very helpful to have the following C functions added to the > FILE_IO interface: > > getcwd - good to be able to tell where you are > > access - good to test to see if a file exists > > Thanks. > > > -- "The secret to creativity is knowing how to hide your sources." Albert Einstein http://soundcloud.com/davidlamkins http://reverbnation.com/lamkins http://reverbnation.com/lcw http://lamkins-guitar.com/ http://lamkins.net/ http://successful-lisp.com/
