On Thu, Aug 8, 2019 at 6:32 PM <xxxxxx@ancell-ent.com> wrote:

While we're still cogitating about whether to split out processes from this SRFI  

I am now firmly of opinion that we should remove all the process-related functions from SRFI 170 along the lines you specified earlier, whatever we decide to do about processes in a future SRFI.  I have some general ideas, but they are stll completely unformed.

(set-file-mode fname/port mode-bits)
(set-file-owner fname/port uid)
(set-file-group fname/port gid)
(set-file-timespecs fname/port [access-timespec modify-timespec])

I say: Switch all these to filenames only.  You shouldn't be changing these things for a file whose identity you dont know, not to mention that they make no sense when applied to non-file ports.

(truncate-file fname/port len)
(file-info fname/port)
These two are a little different, in that the underlying system calls only take a file descriptor, but of course with not much work adding opening and closing a filename is easy:

These are in fact paired: truncate() for files, ftruncate() for fds; stat() for files, fstat() for ports.  Both are useful.  Indeed stat() cannot be implemented with fstat(), because if you can't open() the file you can't fstat() it.  So I say:  Retain the fname/port duality for these.
 
(tty-process-group port/fname)
(set-tty-process-group port/fname process-group)

These go with the process stuff, so no need to decide yet (see above).

I personally have no ideas or feelings about any of these except set-file-timespecs, the scenario being that before you mess with a file you use file-info on the filename to get the access time (I'm assuming that doesn't change it before you get the times), and after opening it you use set-file-timespecs to set the access time back to what it was.  Although that's in the context of backup programs, which this SRFI does not support due to ignoring symlinks, and I suppose without including lseek it can't, since that's needed to restore sparse files.

The FileAdvancedCowan pre-SRFI supports lseek under its R6RS name of get-file-position and set-file-position!



John Cowan          http://vrici.lojban.org/~cowan        xxxxxx@ccil.org
The Penguin shall hunt and devour all that is crufty, gnarly and
bogacious; all code which wriggles like spaghetti, or is infested with
blighting creatures, or is bound by grave and perilous Licences shall it
capture.  And in capturing shall it replicate, and in replicating shall
it document, and in documentation shall it bring freedom, serenity and
most cool froodiness to the earth and all who code therein.  --Gospel of Tux