From: John Cowan <xxxxxx@ccil.org>
Date: Sunday, July 21, 2019 12:46 AM

On Sat, Jul 20, 2019 at 3:44 PM <xxxxxx@ancell-ent.com> wrote:

[...]

 An operation missing from both R7RS and the SRFI that's in Chibi Scheme's filesystem library that I think should be added because of it's trivial implementation is rename-file.  This also gives us the opportunity if we so desire to rename chdir -> change-directory and cwd -> change-working-directory.

I flushed it accidentally. I restored it from the scsh manual and sent you a PR.

The scsh optional argument override?  makes it a bit less "trivial to implement", but it's just a tiny bit more work, check if new-fname exists ... and since this is the difference between mv(1) with and without the -i flag, I think it's well within the remit of this SRFI.  Scsh implements the ask the user y or n if override? behavior of mv -i which makes sense for a Scheme shell, for Chibi Scheme I plan to omit that.

I still want to consider renaming chdir and cwd, their names don't correspond directly to the cd and pwd build in shell commands.  chdir is not bad, that's the name of the system call and the name makes what it does obvious, but "cwd" doesn't correspond to anything POSIX.  Contrary to my above unthinking guess, it returns the current working directory, but sure sounds like it might Change the Working Directory.  Something like return-working-directory would make it self-documenting (and then the "Rename All the Things!" pendant part of me wants to make chdir's name mirror it).

- Harold