Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Here we go again. More CMUCL/ACL pathname differences.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 54 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
robert_m_miles  
View profile  
 More options Jan 9 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: robert_m_mi...@yahoo.com
Date: 1999/01/09
Subject: Here we go again. More CMUCL/ACL pathname differences.
Sunil's example works on CMUCL, but fails on ACL.

The translation is:

  (setf (logical-pathname-translations "lisp")
      `(("source;**;*" ,(make-pathname :directory
                                       '(:absolute "home" "rmiles"
                                                   "code" "lisp"
                                                   "source" :wild-inferiors)
                                       :name :wild
                                       :type "lisp"))
        ("source;**;*.*" ,(make-pathname :directory
                                         '(:absolute "home" "rmiles"
                                                     "code" "lisp"
                                                     "source" :wild-inferiors)
                                         :name :wild
                                         :type "lisp"))))

For CMUCL:
* (translate-logical-pathname "lisp:source;foo")
#p"/home/rmiles/code/lisp/source/foo.lisp"

For ACL:
USER(14): (translate-logical-pathname "lisp:source;foo")
#p"/home/rmiles/code/lisp/source/foo"

The hyperspec doesn't go into great detail about :wild-inferiors so I don't
know if ACL's behavior is in violation of the standard or not. Anyways,
someone posted a way to do what I want that happens to work with both ACL and
CMUCL. If there was a standard defined way to do it, it would be nice, but
there isn't. And I can live with the current way that does work with both
that depends on implementation-defined behavior.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sunil Mishra  
View profile  
 More options Jan 10 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: Sunil Mishra <smis...@whizzy.cc.gatech.edu>
Date: 1999/01/10
Subject: Re: Here we go again. More CMUCL/ACL pathname differences.

robert_m_mi...@yahoo.com writes:
> Sunil's example works on CMUCL, but fails on ACL.

I'd venture then to say that ACL is broken. The translation process ought
to use everything in the translation as a default, if not specified in the
logical pathname. The first translation instructs Lisp to use "lisp" as the
default type, if not supplied. The second instructs it to use "lisp" as the
type, no matter what is supplied. I believe this is obvious in the spec,
though I don't have the time right now to dig up the relevant quotes.

> The hyperspec doesn't go into great detail about :wild-inferiors so I don't
> know if ACL's behavior is in violation of the standard or not. Anyways,
> someone posted a way to do what I want that happens to work with both ACL and
> CMUCL. If there was a standard defined way to do it, it would be nice, but
> there isn't. And I can live with the current way that does work with both
> that depends on implementation-defined behavior.

:wild-inferiors instructs lisp to apply the pathname translation to all
subdirectories, not just the current directory. It ought not affect how the
type is handled. It is a general pathname construct in lisp, not just for
logical pathnames. For example,

(directory "/**/*.lisp")

should generate a list of every lisp file on your hard drive.

Sunil


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
robert_m_miles  
View profile  
 More options Jan 10 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: robert_m_mi...@yahoo.com
Date: 1999/01/10
Subject: Re: Here we go again. More CMUCL/ACL pathname differences.
In article <efyyanagarp....@whizzy.cc.gatech.edu>,
  Sunil Mishra <smis...@whizzy.cc.gatech.edu> wrote:

> For example,

> (directory "/**/*.lisp")

> should generate a list of every lisp file on your hard drive.

Ha ha! This (sorta) works on ACL but fails on CMUCL. Will this stupid pathname
inconsistency crap ever end?

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Naggum  
View profile  
 More options Jan 11 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.no>
Date: 1999/01/11
Subject: Re: Here we go again. More CMUCL/ACL pathname differences.
* robert_m_mi...@yahoo.com
| Will this stupid pathname inconsistency crap ever end?

  only if you want it to.  CMUCL is freeware, so you fix it.  Franz Inc
  engineers may want to satisfy real customer needs.  present your case in
  a bug report.  perhaps I can fix it if I feel like it, but I don't
  generally feel like helping people who don't give me an impression of
  being satisfied if whatever they were complaining about does get fixed.
  so, what would it take for you stop calling it "inconsistency crap"?  do
  you have a clear idea what every single piece of the pathname stuff
  should do?  if not, if somebody fixes one thing and you stumble upon
  another problem, would you come back with another "inconsistency crap"
  complaint?  what if your complaints are themselves inconsistent?

#:Erik


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
robert_m_miles  
View profile  
 More options Jan 12 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: robert_m_mi...@yahoo.com
Date: 1999/01/12
Subject: Re: Here we go again. More CMUCL/ACL pathname differences.
In article <3125045622004...@naggum.no>,
  Erik Naggum <e...@naggum.no> wrote:

> * robert_m_mi...@yahoo.com
> | Will this stupid pathname inconsistency crap ever end?

>   only if you want it to.  CMUCL is freeware, so you fix it.  Franz Inc
>   engineers may want to satisfy real customer needs.  present your case in
>   a bug report.  perhaps I can fix it if I feel like it, but I don't
>   generally feel like helping people who don't give me an impression of
>   being satisfied if whatever they were complaining about does get fixed.
>   so, what would it take for you stop calling it "inconsistency crap"?  do
>   you have a clear idea what every single piece of the pathname stuff
>   should do?  if not, if somebody fixes one thing and you stumble upon
>   another problem, would you come back with another "inconsistency crap"
>   complaint?  what if your complaints are themselves inconsistent?

> #:Erik

I would have liked if the Common Lisp pathname stuff didn't leave so much to
the implementation. For example, how do you find out portably whether or not
a pathname is a valid logical pathname namestring without possibly signalling
an error (calling translate-logical-pathname on it would do the trick but if
it's not valid you get an error)? How do you find out portably if a supplied
physical pathname namestring is a directory or a file? There is no
`directory-p'. How do you portably map all files with an unspecified type to
default type? How do you portably list all files and directories recursively
from a given point? All of these features are provided natively to nearly
every file system around and a portable API to these features that every file
system has could have been implemented but instead we have what I think is
total crap.

I'd love to use CL instead of PERL or the 50% solution for scripting but I
have to use PERL or SH as the glue between the CL modules e.g:

#!/bin/sh
lisp -eval '(load ...)'

So that I have real filesytem control.

No Erik, I don't want you to waste your time fixing anything. It's beyond
fixing. I remember someone mentioning that Genera had a truly sophisticated
portable file-system API but it was deemed too complex for inclusion into
Common Lisp. Maybe someone should get the documentation for the API and then
make an implementation for it that can with some work run on all the major
systems and thus allow it's use to be pervasive and then provide a "Naggum"
license for it that makes it free for non-commercial use and allows
reasonable licensing negotiations for unrestricted commercial use while
ensuring that one standard is maintained. How about you, Erik?

What's going on with the language specification anyways? Is there going to be
another revision or ANSI update in a few years? Could this crap get fixed
then?

Yes, if what I'm bitching about gets fixed then I'll be truly satisfied.

Other than this filesystem crap CL is the greatest language there is. I've
seen plenty of moaning over equal lately but it hasn't bothered me (yet...).

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "A portable DIRECTORY-P. Re: Here we go again. More CMUCL/ACL pathname differences." by Christopher R. Barry
Christopher R. Barry  
View profile  
 More options Jan 12 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: cba...@2xtreme.net (Christopher R. Barry)
Date: 1999/01/12
Subject: A portable DIRECTORY-P. Re: Here we go again. More CMUCL/ACL pathname differences.

robert_m_mi...@yahoo.com writes:
> I would have liked if the Common Lisp pathname stuff didn't leave so
> much to the implementation. For example, how do you find out
> portably whether or not a pathname is a valid logical pathname
> namestring without possibly signalling an error (calling
> translate-logical-pathname on it would do the trick but if it's not
> valid you get an error)? How do you find out portably if a supplied
> physical pathname namestring is a directory or a file? There is no
> `directory-p'.

With some work, this situation could be remedied:

(defun directory-p (path)
  "If PATH is a directory then return it's truename, else return NIL."
  (let ((directory-delimeter
         #+UNIX    "/"
         #+WINDOWS "\\"                       ;FIXME: In *features* for WinXX?
         #+MCL     ":"                        ;FIXME: Make work for any Macintosh CL.
         #+GENERA  ">"                     ;FIXME: Delete me if this is correct.
         ))
    ;; PROBE-FILE will return a truename if an argument with a
    ;; trailing pathname delimeter is a directory, else NIL.
    (probe-file
     ;; If the file already has a trailing delimiter don't append
     ;; another one to it, else append it.
     (if (string-equal (subseq (namestring path)
                               (1- (length (namestring path))))
                       directory-delimeter)
         path
       (concatenate 'string (namestring path) directory-delimeter)))))

Can people with non-unix implementations make the above work right?
One thing that would be nice is if the above function could take
logical pathname arguments but for reasons cited in the previous
article this is not possible to do portably and I think it would take
a lot of work. I'd like to have a LOGICAL-PATHNAME-P so that I could
know that the argument I pass to TRANSLATE-LOGICAL-PATHNAME won't give
an error. Anyone got a flash of insight as to how to implement this?

> How do you portably map all files with an unspecified type to
> default type? How do you portably list all files and directories
> recursively from a given point?

The above DIRECTORY-P should hopefully be portable across all major
implementations soon and with that you could do this.

Christopher


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rainer Joswig  
View profile  
 More options Jan 12 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: jos...@lavielle.com (Rainer Joswig)
Date: 1999/01/12
Subject: Re: A portable DIRECTORY-P. Re: Here we go again. More CMUCL/ACL pathname differences.
In article <87d84lpaxr.fsf...@2xtreme.net>, cba...@2xtreme.net (Christopher R. Barry) wrote:

> robert_m_mi...@yahoo.com writes:

> > I would have liked if the Common Lisp pathname stuff didn't leave so
> > much to the implementation. For example, how do you find out
> > portably whether or not a pathname is a valid logical pathname
> > namestring without possibly signalling an error (calling
> > translate-logical-pathname on it would do the trick but if it's not
> > valid you get an error)? How do you find out portably if a supplied
> > physical pathname namestring is a directory or a file? There is no
> > `directory-p'.

> With some work, this situation could be remedied:

> (defun directory-p (path)

MCL provides CCL:DIRECTORYP .

DIRECTORYP pathname
[Function]
returns true if pathname represents a directory. An error is signalled if
pathname is not a pathname.

> One thing that would be nice is if the above function could take
> logical pathname arguments

CCL:DIRECTORYP works with logical pathnames.

CL-HTTP defines www-utils:pathname-directory-p .

--
http://www.lavielle.com/~joswig


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christopher R. Barry  
View profile  
 More options Jan 12 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: cba...@2xtreme.net (Christopher R. Barry)
Date: 1999/01/12
Subject: Re: A portable DIRECTORY-P. Re: Here we go again. More CMUCL/ACL pathname differences.

jos...@lavielle.com (Rainer Joswig) writes:

[...]

> CL-HTTP defines www-utils:pathname-directory-p .

Indeed. In
./acl/server/unix.lisp
./cmucl/server/unix.lisp
./lcl/server/unix.lisp
./lispm/server/lispm.lisp
./lw/server/unix.lisp
./mcl/server/mcl.lisp

It seems that there is a specific extension for testing for a pathname
directory in every CL. It's nice to have this CL-HTTP code that gives
you a common interface to all of them.

Christopher


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
jon.dyte  
View profile  
 More options Jan 12 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: jon.d...@totient.demon.co.uk
Date: 1999/01/12
Subject: Re: A portable DIRECTORY-P. Re: Here we go again. More CMUCL/ACL pathname differences.
IIRC Ilog Talk ditched all this pathname stuff and used a simple filename
object and #f"/home/jon/example.lisp" type macro reader. Also, all the normal
file io (unlink etc) commands worked, the file permissions were easily
accessible and settable. Also there were functions for symlinks and
directories. The functions had a unix type flavour but were portable across
to win32 platforms. Perhaps Harley can elucidate further? Maybe we should
port this type of interface, as an alternative.

Jon
PS Any chance of a glibc (libc6) port of Talk for linux?

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nick Levine  
View profile  
 More options Jan 12 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: Nick Levine <n...@harlequin.co.uk>
Date: 1999/01/12
Subject: Re: A portable DIRECTORY-P. Re: Here we go again. More CMUCL/ACL pathname differences.

I checked this with Lispworks (version 4.1 on Windows) and it works as-is. Also
checked with Lispworks on Unix and Liquid CL, again your code works as-is.

> One thing that would be nice is if the above function could take
> logical pathname ... I'd like to have a LOGICAL-PATHNAME-P so that I could
> know that the argument I pass to TRANSLATE-LOGICAL-PATHNAME won't give
> an error. Anyone got a flash of insight as to how to implement this?

Probably by knowing the internal function each implementation uses?

    #+lispworks system::logical-pathname-p ; tested in 4.1 releases
    #+liquid liquid::logical-pathname-p    ; from next release

Hope this helps.

- nick


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Here we go again. More CMUCL/ACL pathname differences." by Erik Naggum
Erik Naggum  
View profile  
 More options Jan 12 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.no>
Date: 1999/01/12
Subject: Re: Here we go again. More CMUCL/ACL pathname differences.
* robert_m_mi...@yahoo.com
| I would have liked if the Common Lisp pathname stuff didn't leave so much
| to the implementation.

  so you want more access to the native file system, is that it?  that's OK
  -- every Common Lisp programmer does that, and gets it.  what _I_ don't
  get is why you are surprised that you cannot do this _portably_.  Common
  Lisp is not a Unix language, nor a Bill Gates "innovation".  it predates
  both, see?  at the time Common Lisp was defined file systems far superior
  to what we are used to were the norm, and they differed greatly amongst
  themselves.  the Bill Gates "innovation" doesn't differ from Unix except
  in stupid details like / vs \, so it's easy for someone today to think
  that he should have access to all these things.  the fact is: he has, but
  not in the COMMON-LISP package.

| For example, how do you find out portably whether or not a pathname is a
| valid logical pathname namestring without possibly signalling an error
| (calling translate-logical-pathname on it would do the trick but if it's
| not valid you get an error)?

  you are confusing pathnames and namestrings.  that's a particularly
  stupid thing to do considering your clamoring about how crappy the stuff
  you obviously don't understand is.  your particular case is pretty damn
  easy: call PARSE-NAMESTRING, if the result is of type LOGICAL-PATHNAME,
  it was a valid logical pathname namestring.  of course, you catch parsing
  errors with a simple IGNORE-ERRORS wrapper around that call.

| How do you find out portably if a supplied physical pathname namestring
| is a directory or a file?

  again, you call PARSE-NAMESTRING.  then you see if FILE-NAMESTRING is NIL.

| There is no `directory-p'.

  oh, you mean whether a Unix filename really names a directory?  well,
  this is one of the great mysteries of Unix.  originally, you could use
  `cat' on a directory and look at the bytes.  you can no longer do that.
  Unix's very famous "everything is a file" concept has broken down, but
  not quite.  on other operating systems, you had to specify a different
  pathname to get at the actual directory file, it wasn't just a matter of
  using a different operation on the same pathname.  Unix's simplicity has
  fooled you into believing something that simply does not _portably_ hold
  and now you blame Common Lisp for it.  how fucking intelligent of you.

| How do you portably map all files with an unspecified type to default
| type?

  so you've had a little problem here.  let's solve that problem for you,
  provided that you want it solved and don't just want an eternal excuse.
  some other whining losers who have posted here don't really want their
  solutions solved, they want something to whine about, so they can go back
  to write in Perl.  all they need is an _excuse_ not to go Common Lisp,
  and latching onto some stupid little thing that isn't "portable" is
  enough for them to discard Common Lisp entirely.  pretty amazing, really,
  and probably worth a PhD in psychology.

| How do you portably list all files and directories recursively from a
| given point?

  well, what have you tried?  show us.  why did it fail?

| All of these features are provided natively to nearly every file system
| around and a portable API to these features that every file system has
| could have been implemented but instead we have what I think is total
| crap.

  the problem is primarily your attitude.  this is a technical problem, so
  it has technical solutions.  getting it into the standard is a _separate_
  issue.

| I'd love to use CL instead of PERL or the 50% solution for scripting but
| I have to use PERL or SH as the glue between the CL modules e.g:
|
| #!/bin/sh
| lisp -eval '(load ...)'
|
| So that I have real filesytem control.

  so you're incompetent at using your Common Lisp system.  how surprising.

| No Erik, I don't want you to waste your time fixing anything.

  fixing things isn't a waste of time.

| It's beyond fixing.

  you're not the person I'd trust with such a clear-cut technical answer.
  you simply confuse politics with engineering, and that is not conducive
  to either technical or political answers.

| I remember someone mentioning that Genera had a truly sophisticated
| portable file-system API but it was deemed too complex for inclusion into
| Common Lisp.  Maybe someone should get the documentation for the API and
| then make an implementation for it that can with some work run on all the
| major systems and thus allow it's use to be pervasive and then provide a
| "Naggum" license for it that makes it free for non-commercial use and
| allows reasonable licensing negotiations for unrestricted commercial use
| while ensuring that one standard is maintained.  How about you, Erik?

  it isn't horribly difficult to write your own wrappers around the Unix
  file system cruft and make it portable for _your_ code.  your fixation
  with having somebody else do it for you is _really_ digusting.

  I actually have all I need in Allegro CL, so I have no urgent need to do
  this in the first place.  however, I have been working on various pieces
  in what should become a Common Lisp "wrapper" for all the insanely
  non-portable cruft in the various Unixes, not much different from what
  Perl has done for Unix in principle, only this time in a programming
  language and with a spec.  I call it CLUNIX, pronounced "clue? nix!".

| What's going on with the language specification anyways?  Is there going
| to be another revision or ANSI update in a few years?  Could this crap
| get fixed then?

  look, dude, you are in serious need of attitude readjustment.  you don't
  get people to work on anything, and especially not for free, if you call
  what they do "crap".  reserve expressions of your attitude problem till
  _after_ you have worked on some of this stuff yourself and have been
  turned down for stupid reasons.

| Yes, if what I'm bitching about gets fixed then I'll be truly satisfied.

  I see no evidence of that, since you haven't even bothered to learn to
  use your existing Common Lisp system.  so even if I fix this, I don't
  _expect_ you to sit down and learn how to use it properly, but still come
  back with whining complaints.

| Other than this filesystem crap CL is the greatest language there is.

  and when we fix the filesystem crap, you'll whine about something else
  you'll call crap, too, I'm sure.  there are lots of flaws and problems in
  any environment.  your moral stature is measured by whether you have a
  constructive element to what you do, and whether somebody else can get at
  that constructive element and suggest things you can do.  if constructive
  suggestions don't work, there is legitimate cause to believe you have no
  constructive element at all, and therefore must be treated as destructive.

  until next time, your homework assignment is to write a specification for
  the file system interface you want.  I will call it crap without reading
  it, in the spirit of your treatment of the CL pathname system.  then we
  can discuss it "openly".  and finally, we send it all to Scott Adams.

#:Erik


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "A portable DIRECTORY-P. Re: Here we go again. More CMUCL/ACL pathname differences." by Erik Naggum
Erik Naggum  
View profile  
 More options Jan 12 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.no>
Date: 1999/01/12
Subject: Re: A portable DIRECTORY-P. Re: Here we go again. More CMUCL/ACL pathname differences.
* cba...@2xtreme.net (Christopher R. Barry)
| I'd like to have a LOGICAL-PATHNAME-P so that I could know that the
| argument I pass to TRANSLATE-LOGICAL-PATHNAME won't give an error.
| Anyone got a flash of insight as to how to implement this?

(defun logical-pathname-p (pathname)
  (typep pathname 'logical-pathname))

  chances are the function already exists if PATHNAME and LOGICAL-PATHNAME
  are both structures defined with DEFSTRUCT, and you just need APROPOS to
  find it.  there's nothing inherently evil in using non-exported functions
  or functions not in the COMMON-LISP package.  you just need to know what
  you are doing.  that's never a bad thing.

#:Erik


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Harley Davis  
View profile  
 More options Jan 12 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: "Harley Davis" <spamless_davis@spamless_ilog.com>
Date: 1999/01/12
Subject: Re: A portable DIRECTORY-P. Re: Here we go again. More CMUCL/ACL pathname differences.

>IIRC Ilog Talk ditched all this pathname stuff and used a simple filename
>object and #f"/home/jon/example.lisp" type macro reader. Also, all the
normal
>file io (unlink etc) commands worked, the file permissions were easily
>accessible and settable. Also there were functions for symlinks and
>directories. The functions had a unix type flavour but were portable across
>to win32 platforms. Perhaps Harley can elucidate further? Maybe we should
>port this type of interface, as an alternative.

One of ILOG Talk's primary goals was to simplify the integration of Lisp
programs with C/C++ programs on de facto standard platforms.  This led us to
decde that ILOG Talk's file subsystem would be based largely on Posix; it
included the following functions:

;;; Filename functions
(make-filename <string>) -> <filename>
#f"string" -> <filename>
(filenamep <object>) -> boolean
(string <filename>) -> <string>
(basename <filename> optional: extension) -> <filename>
(extension <filename>) -> <string>
(dirname <filename>) -> <filename>
(device <filename>) -> <string> ; for Windows...
(merge-filenames <filename> <filename> optional: suffix) -> <filename>

;;; File operations, based on Posix
(access <filename> optional: modes) -> boolean ; modes is a list of R_OK,
etc.
(getcwd) -> <filename> ; setf'able
(mkdir <filename>) -> <filename>
(rmdir <filename>) -> <filename>
(rename <filename> <filename>) -> <filename> ; mv arg1 arg2
(tmpnam) -> <filename> ; a gensym for files
(unlink <filename>) -> <filename> ; rm arg1

;;; Functions based on stat()...
(file-ino <filename>) -> <int>  ; inode - almost works on NT
(file-dev <filename>) -> <int>  ; device - this + inode uniquely identifies
file
(file-nlink <filename>) -> <int> ; # of physical links to a file
(file-size <filename>) -> <int> ; bytes in a file
(file-atime <filename>) -> <time> ; last access time
(file-ctime <filename>) -> <time> ; creation time
(file-mtime <filename>) -> <time> ; modification time
(file-type <filename>) -> <symbol> ; S_ISDIR, S_ISFIFO, etc. based on Posix
macros

;;; Symbolic link stuff - not derived from Posix but quite important.
(file-link-p <filename>) -> boolean
(readlink <filename>) -> <filename> ; follow the link

;;; Etc.
(copy-file <filename> <filename> optional: appendp) -> <filename> ; cp arg1
arg2
(path) -> <list> of <filename> ; used in following fns; setfable
(which <string> optional: <string>) ; searches in path for basename and
optional extension
in-directory: ; used in Talk's "for" macro to loop through files in a
directory

Talk also included a bunch of stream operations based on Posix, including
fopen and the printf family as well as select() and a full set of socket and
pipe functions.   Everything was ported between Unix and Windows.  We never
considered other platforms as very important in our deliberations.

I thought it was cool, anyway.

-- Harley

>Jon
>PS Any chance of a glibc (libc6) port of Talk for linux?

You'll have to ask Bruno Haible (hai...@ilog.fr), who's taking care of that
stuff.  I'm quite distant from it now.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Here we go again. More CMUCL/ACL pathname differences." by Tim Bradshaw
Tim Bradshaw  
View profile  
 More options Jan 12 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: Tim Bradshaw <t...@aiai.ed.ac.uk>
Date: 1999/01/12
Subject: Re: Here we go again. More CMUCL/ACL pathname differences.
* robert m miles wrote:

> What's going on with the language specification anyways? Is there going to be
> another revision or ANSI update in a few years? Could this crap get fixed
> then?
> Yes, if what I'm bitching about gets fixed then I'll be truly satisfied.
> Other than this filesystem crap CL is the greatest language there is. I've
> seen plenty of moaning over equal lately but it hasn't bothered me (yet...).

Well, one way of helping it get fixed would be if people who find it a
problem tried to come up with a proposed set of changes (which should
be upwards compatible) which would make things better, and then making
them available for other people to comment on. That's really a much
better approach than just saying `this is crap'.  If people want the
language to improve then acting positively like this is a good way of
helping that happen.  Of course it's also a much *harder* approach
than just whinging, because it often turns out that these things are
pretty hard to get right.

--tim


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "A portable DIRECTORY-P. Re: Here we go again. More CMUCL/ACL pathname differences." by Christopher R. Barry
Christopher R. Barry  
View profile  
 More options Jan 12 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: cba...@2xtreme.net (Christopher R. Barry)
Date: 1999/01/12
Subject: Re: A portable DIRECTORY-P. Re: Here we go again. More CMUCL/ACL pathname differences.

Erik Naggum <e...@naggum.no> writes:
> * cba...@2xtreme.net (Christopher R. Barry)
> | I'd like to have a LOGICAL-PATHNAME-P so that I could know that the
> | argument I pass to TRANSLATE-LOGICAL-PATHNAME won't give an error.
> | Anyone got a flash of insight as to how to implement this?

> (defun logical-pathname-p (pathname)
>   (typep pathname 'logical-pathname))

USER(8): (defun logical-pathname-p (pathname)
           (typep pathname 'logical-pathname))
LOGICAL-PATHNAME-P
USER(9): (logical-pathname-p "sys:hosts.cl")
NIL
USER(10): (translate-logical-pathname "sys:hosts.cl")
#p"/usr/local/acl5/hosts.cl"

CL-HTTP has a way that works really well though.

Christopher


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lyman S. Taylor  
View profile  
 More options Jan 12 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: ly...@cc.gatech.edu (Lyman S. Taylor)
Date: 1999/01/12
Subject: Re: A portable DIRECTORY-P. Re: Here we go again. More CMUCL/ACL pathname differences.
In article <877lususje....@2xtreme.net>,
Christopher R. Barry <cba...@2xtreme.net> wrote:

>USER(9): (logical-pathname-p "sys:hosts.cl")

                              ^^^^^^^^^^^^^^  

  This is a string (or a simple-array of characters).
  Not a pathname.

USER(18): (make-pathname :host "sys" :name "hosts" :type "cl" )
#p"sys:hosts.cl"
USER(19): (typep * 'logical-pathname )
T

  The #P in front means it is a pathname.   You can use write the literal
  pathname to #p"sys.hosts.cl"

>USER(10): (translate-logical-pathname "sys:hosts.cl")
>#p"/usr/local/acl5/hosts.cl"

   Fortunately, the translate-logical-pathname function can do a implicit
   conversion to an actual pathname.

--

Lyman S. Taylor                "Twinkie Cream; food of the Gods"
(ly...@cc.gatech.edu)                     Jarod, "The Pretender"


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christopher R. Barry  
View profile  
 More options Jan 12 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: cba...@2xtreme.net (Christopher R. Barry)
Date: 1999/01/12
Subject: Re: A portable DIRECTORY-P. Re: Here we go again. More CMUCL/ACL pathname differences.
ly...@cc.gatech.edu (Lyman S. Taylor) writes:

> In article <877lususje....@2xtreme.net>,
> Christopher R. Barry <cba...@2xtreme.net> wrote:

> >USER(9): (logical-pathname-p "sys:hosts.cl")
>                               ^^^^^^^^^^^^^^  

>   This is a string (or a simple-array of characters).
>   Not a pathname.

Whoops.... Thanks, I've been bitten by this issue before and should
have learned by now. (It was the other way around, I wrote code that
assumed that a pathname passed to it was a of type SIMPLE-ARRAY of
CHARACTER, and taking the length of #P"sys:hosts.cl" won't work).

Christopher


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Naggum  
View profile  
 More options Jan 12 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.no>
Date: 1999/01/12
Subject: Re: A portable DIRECTORY-P. Re: Here we go again. More CMUCL/ACL pathname differences.
* cba...@2xtreme.net (Christopher R. Barry)
| USER(8): (defun logical-pathname-p (pathname)
|          (typep pathname 'logical-pathname))
| LOGICAL-PATHNAME-P
| USER(9): (logical-pathname-p "sys:hosts.cl")
| NIL

  why do you expect a string to be a pathname?

  do you expect (null "()") to return true, too?

#:Erik


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christopher R. Barry  
View profile  
 More options Jan 13 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: cba...@2xtreme.net (Christopher R. Barry)
Date: 1999/01/13
Subject: Re: A portable DIRECTORY-P. Re: Here we go again. More CMUCL/ACL pathname differences.

Erik Naggum <e...@naggum.no> writes:
> * cba...@2xtreme.net (Christopher R. Barry)
> | USER(8): (defun logical-pathname-p (pathname)
> |     (typep pathname 'logical-pathname))
> | LOGICAL-PATHNAME-P
> | USER(9): (logical-pathname-p "sys:hosts.cl")
> | NIL

>   why do you expect a string to be a pathname?

Because in practice most of the time it doesn't make a difference for
many of the functions if their argument is logical-pathname or a
SIMPLE-STRING of type CHARACTER that denotes a logical-pathname
namestring (if that's even the proper terminology).

USER(22): (pathname-host "lisp:code;foo")
"lisp"

I've gotten into the bad habit of using them interchangably, but now
I'm less assuming. I find there are many pitfalls like this in this
huge language (or small language with huge standard library if that's
how you prefer to look at it).

>   do you expect (null "()") to return true, too?

Hmm... no. Maybe (null (read-from-string "()")) though.

Christopher


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
vnikolov  
View profile  
 More options Jan 13 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: vniko...@poboxes.com
Date: 1999/01/13
Subject: Re: A portable DIRECTORY-P. Re: Here we go again. More CMUCL/ACL pathname differences.
In article <3125142331394...@naggum.no>,
  Erik Naggum <e...@naggum.no> wrote:

> * cba...@2xtreme.net (Christopher R. Barry)
> | I'd like to have a LOGICAL-PATHNAME-P so that I could know that the
> | argument I pass to TRANSLATE-LOGICAL-PATHNAME won't give an error.
> | Anyone got a flash of insight as to how to implement this?

> (defun logical-pathname-p (pathname)
>   (typep pathname 'logical-pathname))

Isn't (something like) LOGICAL-PATHNAME-NAMESTRING-P really
what is needed?  That's not so trivial.

On a related issue:
Wasn't it Erik Naggum who wrote that ACL has #L precisely
because sometimes one wants to force a namestring to be
parsed as a logical pathname.

By the way, would (PROBE-FILE "foo/.") do the directory-p
test in a Unix CL?  (And in a Microsoft environment, I _think_
probing "foo\\con" might work, at least it did with some
versions of MSDOS.)

Have a nice day or night,
Vassil.

Vassil Nikolov <vniko...@poboxes.com> www.poboxes.com/vnikolov
(You may want to cc your posting to me if I _have_ to see it.)
   LEGEMANVALEMFVTVTVM  (Ancient Roman programmers' adage.)

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
vnikolov  
View profile  
 More options Jan 13 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: vniko...@poboxes.com
Date: 1999/01/13
Subject: Re: A portable DIRECTORY-P. Re: Here we go again. More CMUCL/ACL pathname differences.
In article <369B59EA.1B19B...@harlequin.co.uk>,
  Nick Levine <n...@harlequin.co.uk> wrote:

Instead of introducing OS dependence (with all those #+ delimiters),
I'd rather parse the namestring, then, if the filename+filetype
components are not empty, would make a new pathname object with
file{name,type} nil and the original file{name,type} appended
to the pathname-directory list.

In CL, manipulating pathnames is _not_ about manipulating strings
(unless the implementation of PARSE-NAMESTRING is broken, which
normally it isn't) but about manipulating pathname structures
in a (rather) OS-independent way.

Vassil Nikolov <vniko...@poboxes.com> www.poboxes.com/vnikolov
(You may want to cc your posting to me if I _have_ to see it.)
   LEGEMANVALEMFVTVTVM  (Ancient Roman programmers' adage.)

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Naggum  
View profile  
 More options Jan 13 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.no>
Date: 1999/01/13
Subject: Re: A portable DIRECTORY-P. Re: Here we go again. More CMUCL/ACL pathname differences.
* cba...@2xtreme.net (Christopher R. Barry)
| Because in practice most of the time it doesn't make a difference for
| many of the functions if their argument is logical-pathname or a
| SIMPLE-STRING of type CHARACTER that denotes a logical-pathname
| namestring (if that's even the proper terminology).

  the technical term is pathname designator.  I love designators, myself,
  but I go out of my way to read the specification and know when I'm using
  a designator and when I'm using the real object, specifically by knowing
  what types the function _really_ takes.  I think this is much easier than
  having to deal with the obvious problems resulting from confusing a type
  with the set of types of designators for that type.

| I've gotten into the bad habit of using them interchangably, but now I'm
| less assuming.

  you should be able to, most of the time, but when you ask for specific
  details about the _type_, you can no longer assume that some function
  will magically "know" that you want what it might designate to some other
  function.  "lisp:code;fun" is a string and nothing but a string.  a
  string is a pathname designator and functions that expect a pathname will
  accept a string to make your life easier.  when this designator business
  makes people's lives harder, it's time for those people to stop using
  them and go back to using the real object types and to read the spec to
  see what kind of argument types the functions they call actually take.

  I think good Common Lisp programmers implement designators to make their
  own lives easier, too, but it takes a little extra effort in the code to
  be able to handle designators, but I'd imagine that some macro or other
  would take care of these things.

| I find there are many pitfalls like this in this huge language (or small
| language with huge standard library if that's how you prefer to look at
| it).

  one man's convenience is another man's pitfall, obviously, but it's not
  something that happens by random.  you chose to ignore the specification
  and stumble ahead with whatever "works".  that's how pitfalls are made.

| >   do you expect (null "()") to return true, too?
|
| Hmm... no. Maybe (null (read-from-string "()")) though.

  I expect you see the need to call PARSE-NAMESTRING on the string, too.

#:Erik


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Naggum  
View profile  
 More options Jan 13 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.no>
Date: 1999/01/13
Subject: Re: A portable DIRECTORY-P. Re: Here we go again. More CMUCL/ACL pathname differences.
* vniko...@poboxes.com
| Isn't (something like) LOGICAL-PATHNAME-NAMESTRING-P really
| what is needed?  That's not so trivial.

  sigh.

(defun logical-pathname-namestring-p (namestring)
  (typep (ignore-errors (parse-namestring namestring)) 'logical-pathname))

| On a related issue:
| Wasn't it Erik Naggum who wrote that ACL has #L precisely
| because sometimes one wants to force a namestring to be
| parsed as a logical pathname.

  care to share the intermediate assumptions and/or your conclusions that
  might tie this unrelated "issue" to something?  I actually think you're
  missing something really fundamental to parsing namestrings, and it would
  be a boon for everyone if you would realize it and try to understand,
  especially for me if you are going to continue to post "related issues"
  that aren't but which inexplicably refer to something I have said which
  you obviously didn't understand, either.

#:Erik


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Naggum  
View profile  
 More options Jan 13 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.no>
Date: 1999/01/13
Subject: Re: A portable DIRECTORY-P. Re: Here we go again. More CMUCL/ACL pathname differences.
* vniko...@poboxes.com
| Instead of introducing OS dependence (with all those #+ delimiters), I'd
| rather parse the namestring, then, if the filename+filetype components
| are not empty, would make a new pathname object with file{name,type} nil
| and the original file{name,type} appended to the pathname-directory list.

  that was _almost_ code.

(defun pathname-as-directory (pathname)
  (setq pathname (pathname pathname))
  (let ((filename (file-namestring pathname)))
    (if filename
      (make-pathname :defaults pathname
                     :directory (append (pathname-directory pathname)
                                        (list filename))
                     :name nil :type nil :version nil)
      pathname)))

#:Erik


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
vnikolov  
View profile  
 More options Jan 13 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: vniko...@poboxes.com
Date: 1999/01/13
Subject: Re: A portable DIRECTORY-P. Re: Here we go again. More CMUCL/ACL pathname differences.
In article <3125219688137...@naggum.no>,
  Erik Naggum <e...@naggum.no> wrote:

> * vniko...@poboxes.com
> | Instead of introducing OS dependence (with all those #+ delimiters), I'd
> | rather parse the namestring, then, if the filename+filetype components
> | are not empty, would make a new pathname object with file{name,type} nil
> | and the original file{name,type} appended to the pathname-directory list.

>   that was _almost_ code.

My father liked to say on similar occasions, sapienti sat.
(I got my weakness for Latin from him.)

> (defun pathname-as-directory (pathname)
>   (setq pathname (pathname pathname))
>   (let ((filename (file-namestring pathname)))
>     (if filename
>       (make-pathname :defaults pathname
>                 :directory (append (pathname-directory pathname)
>                                    (list filename))
>                 :name nil :type nil :version nil)
>       pathname)))

Precisely.  (Sorry for getting the indentation screwed.)

I like it so much when the language provides the appropriate
primitives (like FILE-NAMESTRING in this example).

> #:Erik

Have nice times,
Vassil.

Vassil Nikolov <vniko...@poboxes.com> www.poboxes.com/vnikolov
(You may want to cc your posting to me if I _have_ to see it.)
   LEGEMANVALEMFVTVTVM  (Ancient Roman programmers' adage.)

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 1 - 25 of 54   Newer >
« Back to Discussions « Newer topic     Older topic »