Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

More inconsistencies with file/directory operations

3 views
Skip to first unread message

JP Massar

unread,
Oct 10, 2001, 4:20:56 PM10/10/01
to
Using Windows

(rename-file "C:/Lispcode/foo" "C:/Lispcode/bar")

where foo is a subdirectory of Lispcode

Lispworks allows one to rename the directory using RENAME-FILE as
above.

Allegro does not; RENAME-FILE tells you that the file FOO does not
exist. (nor does including a terminating '/' work). The only way
to rename a directory is to use implementation-specific EXCL:
functions to copy the directory and then delete the old one.

Corman Lisp doesn't have a RENAME-FILE function.


Erik Naggum

unread,
Oct 11, 2001, 5:30:40 AM10/11/01
to
* mas...@alum.mit.edu (JP Massar)

| Allegro does not; RENAME-FILE tells you that the file FOO does not
| exist. (nor does including a terminating '/' work). The only way
| to rename a directory is to use implementation-specific EXCL:
| functions to copy the directory and then delete the old one.

Are you sure the file that holds the directory is not _actually_ called
something else? foo.dir or something? As far as I know, it is fairly
unique to Unix to have directories that are available in the file system
as files with exactly the same name as the directory. But I have made it
a point of personal pride not to be infected by STDs or Microsoft.

///
--
My hero, George W. Bush, has taught me how to deal with people. "Make no
mistake", he has said about 2500 times in the past three weeks, and those
who make mistakes now feel his infinite wrath, or was that enduring care?

JP Massar

unread,
Oct 11, 2001, 12:22:41 PM10/11/01
to
On Thu, 11 Oct 2001 09:30:40 GMT, Erik Naggum <er...@naggum.net> wrote:

>* mas...@alum.mit.edu (JP Massar)
>| Allegro does not; RENAME-FILE tells you that the file FOO does not
>| exist. (nor does including a terminating '/' work). The only way
>| to rename a directory is to use implementation-specific EXCL:
>| functions to copy the directory and then delete the old one.
>
> Are you sure the file that holds the directory is not _actually_ called
> something else? foo.dir or something? As far as I know, it is fairly
> unique to Unix to have directories that are available in the file system
> as files with exactly the same name as the directory. But I have made it
> a point of personal pride not to be infected by STDs or Microsoft.
>

The Windows API function 'MoveFile' works fine to rename a directory
when you give it the name as shown by a directory listing.

So if it is 'really' called something else the OS is doing a pretty
good job of hiding that fact.


0 new messages