Replies: 6 comments 8 replies
-
One issue is that TEDIT (and TEDIT-SEE) want to open the file for input, but the stream is specified as OUTPUT in this example.
But if you open it BOTH, it still fails. But the failure is not in TEDIT-SEE or TEDIT, it seems that CL:OPEN doesn’t work right for {NODIRCORE}:
For
(SETQ X (CL:OPEN ‘{NODIRCORE} :IO))
you get a pathname that shows an empty string, and then
(CL:OPEN X :INPUT) gives the file-not-found error.
TEDIT-SEE (but not TEDIT) runs into this because TEDIT-SEE is using CL:WITH-OPEN-FILE to guarantee that the input file will be closed on exit from this scope, and CL:WITH-OPEN-FILE uses CL:OPEN. (TEDIT-SEE will actually translate a Lisp source file into a scratch image file so that the font-change and other possible formatting control characters are rendered properly.)
So I think the bug is in the way that CL:OPEN treats {NODIRCORE} files, possibly because those files by definition don’t have ordinary directory-like file names. Or possibly the fix would be to make the NODIRCORE take better care to fake up what looks like an actual name that would make the commonlisp functions happy.
Separately, it doesn’t make sense to do TEDIT-SEE on an empty input stream.
… On Jun 8, 2023, at 9:14 AM, Paolo Amoroso ***@***.***> wrote:
Suppose I create a temporary core file:
(SETQ S (OPENSTREAM '{NODIRCORE} 'OUTPUT}
(PRINTOUT S "This is some text" T)
(FORCEOUTPUT S)
If I try to display the file with TEDIT-SEE:
(TEDIT-SEE S)
I get the error File not found: #.(PATHNAME ""). Is TEDIT-SEE supposed to work with {NODIRCORE} files? Am I going through the right steps? According to IRM:
The "name" of such a file is simply the stream object returned from (OPENSTREAM ’{NODIRCORE} ’OUTPUT), and it is this stream object that must be passed to all input/output operations, including CLOSEF and any calls to OPENSTREAM to reopen the file.
So I think the stream S may be passed to TEDIT-SEE.
TEDIT-SEE works fine with {CORE} files.
—
Reply to this email directly, view it on GitHub <#1235>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AQSTUJLTUDHOI3RV6JWJ5XTXKH25PANCNFSM6AAAAAAY7QQCBA>.
You are receiving this because you are subscribed to this thread.
|
Beta Was this translation helpful? Give feedback.
-
Thanks, I wasn't sure this was a bug or some kind of expected behavior. This discussion may be turned into a issue, but using |
Beta Was this translation helpful? Give feedback.
-
@rmkaplan What do you mean? |
Beta Was this translation helpful? Give feedback.
-
The difference is that the storage for {NODIRCORE} gets collected when all references to the stream are gone, whereas {CORE} files will say around until they are explicitly deleted (or the sysout is discarded).
… On Jun 9, 2023, at 2:50 AM, Paolo Amoroso ***@***.***> wrote:
Thanks, I wasn't sure this was a bug or some kind of expected behavior. This discussion may be turned into a issue, but using {CORE} files is a good workaround.
—
Reply to this email directly, view it on GitHub <#1235 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AQSTUJOAVJNCBLOXWHBE4XDXKLWU7ANCNFSM6AAAAAAY7QQCBA>.
You are receiving this because you commented.
|
Beta Was this translation helpful? Give feedback.
-
A string stream would be simpler, wouldn't it? |
Beta Was this translation helpful? Give feedback.
-
I have fixed TEDIT-SEE in the new TEDIT, so that it uses OPENSTREAM instead of the commonlisp macros, and therefore does OK on stream arguments. And, if FILE is an already open stream (like {NODIRCORE}), it leaves the file open on exit.
But that doesn’t address the more general problem that the commonlisp macros are more sensitive than Interlisp function with respect to stream arguments. That may still be an issue.
… On Jul 22, 2023, at 9:25 PM, Larry Masinter ***@***.***> wrote:
suggest converting this discussion to an issue, tag: Bug, project: system
—
Reply to this email directly, view it on GitHub <#1235 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AQSTUJNNTWHLJPKU5GA723TXRSRUDANCNFSM6AAAAAAY7QQCBA>.
You are receiving this because you were mentioned.
|
Beta Was this translation helpful? Give feedback.
-
Suppose I create a temporary core file:
If I try to display the file with
TEDIT-SEE
:I get the error
File not found: #.(PATHNAME "")
. IsTEDIT-SEE
supposed to work with{NODIRCORE}
files? Am I going through the right steps? According to IRM:So I think the stream
S
may be passed toTEDIT-SEE
.TEDIT-SEE
works fine with{CORE}
files.Beta Was this translation helpful? Give feedback.
All reactions