[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Displaying Unix file information in DIRED

    Date: Sat, 21 Jul 90 12:56 PDT
    From: Reti@STONY-BROOK.SCRC.Symbolics.COM (Kalman Reti)

	Date: Fri, 20 Jul 90 21:07 PDT
	From: snicoud@atc.boeing.com (Stephen L. Nicoud)

	Is there a way to modify Zmacs' DIRED so that it displays the
    This is easy, since FS:DIRECTORY-LIST already returns a :PROTECTION
    field (at least for FTP, I don't have an NFS host to try it on).  

Why don't you have an NFS host to try it on?  There must be at least one
UX400S there at Symbolics.

    that is necessary is to modify the file lister to print it (code example
    provided below).  Any other information that is returned in the property
    list is similarly a snap to add (I have a private patch that returns the
    LMFS partition id, for example).
		     group ownership 
    This is currently not returned by FS:DIRECTORY-LIST (via FTP, again I
    can't test NFS).  This is because we don't parse it in the FTP response
    to a LIST command; I've been told that there is a great variability in
    what comes back from various hosts' FTP servers since the format is 
    intended to be viewed by humans instead of programs.  The comments in the
    source code for the Unix directory list parser indicate
    that the group field is only present sometimes, but assuming you deal only
    with hosts that provide it, I've also included the trivial change below.

The most common Unix FTP server will only include the group name if the
LIST command is invoked with the "-g" option (it simply passes the LIST
argument as arguments to the Unix "ls" command).  I believe the 8.1 Unix
FTP client includes my changes to directory listing that supports
passing options.

    It took a total of about 5 minutes to find which functions to modify on
    my machine, and probably another 5-10 minutes to modify them and test

Then how come you did it the way you did?  As you must have noticed in
your investigation, the directory list formatter is called through the
variable ZWEI:*DIRECTORY-SINGLE-FILE-LISTER*, so instead of modifying a
function you should write a new function (which could be a modified
version of the original function) and set the variable to this.  My
general rule is: only modify a function as a last resort.  In this case
there's a hook variable, and frequently you can accomplish what you want

		 ;; Group
		 (add-property :group (pop tokens))

Symbolics NFS calls this property :ACCOUNT, not :GROUP, presumably for
consistency with the TOPS-20 support.

I sent my version of the patch that does to this to Stephen under
separate cover (since it includes modified Symbolics code, and I don't
have the right to publish that to SLUG).