Google 網路論壇不再支援新的 Usenet 貼文或訂閱項目,但過往內容仍可供查看。

More inconsistencies with file/directory operations

瀏覽次數:3 次
跳到第一則未讀訊息

JP Massar

未讀,
2001年10月10日 下午4:20:562001/10/10
收件者:
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

未讀,
2001年10月11日 清晨5:30:402001/10/11
收件者:
* 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

未讀,
2001年10月11日 中午12:22:412001/10/11
收件者:
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 則新訊息