[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Issue: PATHNAME-SYSTEM-TYPE (version 1)
- To: CL-Cleanup@sail.stanford.edu
- Subject: Issue: PATHNAME-SYSTEM-TYPE (version 1)
- From: David A. Moon <Moon@STONY-BROOK.SCRC.Symbolics.COM>
- Date: Tue, 23 May 89 14:06 EDT
This is a new issue. It arose from an investigation of features
that are plausibly needed but missing from draft ANSI Common Lisp.
This issue seems sufficiently simple and noncontroversial that
I would like to see it on the agenda for the June X3J13 meeting.
Let's use the cleanup subcommittee to test the assertion that this
is a simple and noncontroversial issue. If it's controversial,
let's just drop it, otherwise let's give X3J13 a chance to vote
for or against it.
References: Internet RFC 1010, pages 24-25
Related issues: PATHNAME-LOGICAL
Edit history: 23-May-89, Version 1 by Moon
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.
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
:UNIX Unix with long file names (4.2 or newer)
:VMS VAX/VMS with long file names (version 4.4 or newer)
The following additional symbols are specified by Common Lisp:
:LOGICAL logical pathname (see issue PATHNAME-LOGICAL)
: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.
;; On a non-networked IBM PC:
(PATHNAME-SYSTEM-TYPE (USER-HOMEDIR-PATHNAME)) => :MSDOS
PATHNAME-SYSTEM-TYPE gives a nonportable pathname manipulation program
the basic information it needs to interpret namestrings and manipulate
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:
Cost to Users:
Cost of non-adoption:
Implementation-dependent kludges will have to be used.
Implementation-dependent kludges will not have to be used.