Cleanup Issue PATHNAME-SYSTEM-TYPE

Status
failed, Jun 89 X3J13
Category
ADDITION
References
Internet RFC 1010, pages 24-25
Related issues
PATHNAME-LOGICAL

Problem Description

It is sometimes necessary to write nonportable pathname manipulation code that performs operations specific to individual file systems. Sometimes this is to get around inadequacies of the Common Lisp pathname model, sometimes it is to take advantage of idiosyncratic features of a particular file system. Common Lisp does not provide any way to ask what file system a pathname is for, so there is no good way for this type of pathname manipulation code to be sure what file system it is dealing with. Sometimes it can tell by checking what Lisp implementation it is running in, but as more and more implementations support network file access, this is becoming less reliable.

Proposal (ADD-FUNCTION)

Add the following function:

PATHNAME-SYSTEM-TYPE pathname [Function]

Coerce the pathname argument to a pathname, signalling an error of type TYPE-ERROR if the argument is not a pathname, string, or file stream. Return a keyword symbol that identifies the type of file system this pathname is for. The names of these symbols are derived from the system type names used by the Internet Domain Name system, listed in the referenced document. Implementations that use a file system listed in that document, or superseding documents, should return a symbol in the keyword package whose name comes from that document. Examples:

:MSDOS MS/DOS or PC/DOS :TOPS10 TOPS-10 :TOPS20 TOPS-20 :ULTRIX Ultrix :UNIX Unix with long file names (4.2 or newer) :VM/370 VM/370 :VMS VAX/VMS with long file names (version 4.4 or newer) :XENIX Xenix

The following additional symbols are specified by Common Lisp:

:LOGICAL logical pathname (see issue PATHNAME-LOGICAL) :MACINTOSH MacOS (missing from RFC 1010 for some reason) :UNIX-14 Unix with 14-character file name limit :VMS-9 VAX/VMS with 9-character file name limit NIL system type cannot be determined

For file systems not named in the referenced document, implementations should make up a name consistent with the spelling conventions defined in that document.

Examples

  ;; On a non-networked IBM PC:
  (PATHNAME-SYSTEM-TYPE (USER-HOMEDIR-PATHNAME)) => :MSDOS

Rationale

PATHNAME-SYSTEM-TYPE gives a nonportable pathname manipulation program the basic information it needs to interpret namestrings and manipulate pathname components.

Current Practice

Symbolics Genera has had a similar feature under a different name for many years. A few of the keyword symbols returned by Genera are spelled differently, merely for historical reasons.

Cost to Implementors

Trivial.

Cost to Users

None.

Cost of Non-Adoption

Implementation-dependent kludges will have to be used.

Performance Impact

None.

Benefits

Improved esthetics.

Aesthetics

Implementation-dependent kludges will not have to be used.

Discussion

Some people feel that this feature is unnecessary.

Edit History