Re: errors on streams

[email protected] (Don Cohen)
Newsgroups gmane.lisp.clisp.devel
Message-ID <[email protected]>
Bruno Haible writes:
 > Of course you should never build any package as 'root'.

An yet there are features that can only be used as root, so if you
want to test them you have to test as root.

 > But what are the "permission denied errors from streams" that you
 > mention?

(WITH-OPEN-FILE (COPY S) (STREAMP COPY))
[OS-FILE-ERROR]: OS-FILE-ERROR(13): Permission denied

(STREAMP (SETQ S (MAKE-STREAM :INPUT)))
EQL-OK: T
(OR (NOT (SEARCH "#P" (PRIN1-TO-STRING S))) (PATHNAMEP (TRUENAME S)))
EQL-OK: T
(HANDLER-CASE (WRITE-LINE "foo" S) (STREAM-ERROR (C) (PRINC-ERROR C) T))
[SIMPLE-STREAM-ERROR]: WRITE-CHAR on #1=#<INPUT UNBUFFERED FILE-STREAM CHARACTER #P"/dev/fd/0" @1> is illegal

EQL-OK: T
(WITH-OPEN-FILE (COPY S) (STREAMP COPY))
[OS-FILE-ERROR]: OS-FILE-ERROR(13): Permission denied

whereas above returns T as root

in this case:
[7]> s
#<INPUT UNBUFFERED FILE-STREAM CHARACTER #P"/dev/fd/0" @1>


(STREAMP (SETQ S (MAKE-STREAM :ERROR)))
EQL-OK: T
(OR (NOT (SEARCH "#P" (PRIN1-TO-STRING S))) (PATHNAMEP (TRUENAME S)))
EQL-OK: T
(WRITE-LINE "foo" S)
foo
EQUAL-OK: "foo"
(LET ((*REOPEN-OPEN-FILE* NIL)) (WITH-OPEN-FILE (COPY S :DIRECTION :OUTPUT) (STREAMP COPY)))
[OS-FILE-ERROR]: OS-FILE-ERROR(13): Permission denied

returns T as root

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
clisp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.