From 5b37dd09db4bba3633a5bed30de4bb53a7ced539 Mon Sep 17 00:00:00 2001 From: rmkaplan <69548581+rmkaplan@users.noreply.github.com> Date: Wed, 25 Dec 2024 13:06:35 -0800 Subject: [PATCH] Rmk32 eol convention for input defaults to ANY, extend OPENSTREAM so that EOL can be specified as an "external format" (#1785) * FILEIO: EOL for input defaults to ANY, EXT-FORMAT can specify EOL As per technical meeting on 7/15/2024 * Revert "FILEIO: EOL for input defaults to ANY, EXT-FORMAT can specify EOL" This reverts commit 6a7e8c3665bbdcb401f81aa49eadb603874fb4b2. * FILEIO: Fix comment * Added DETECTEDEOLCONVENTION to STREAM declaration and recompiled calls to macro \CHECKEOLC. * COMAPARETEXT: was trying to set EOL to ANY on a Tedit stream * LCOMS needing to be recompiled for \CHECKEOLC macro and Create STREAM (plus a new (unchanged) version of IOCHAR needed to get the cleanup to work for the recompile) * EXTERNALFORMAT macro and function implement EOL detection * FILEIO: stream records detected EOL, also RENAMEFILE uses COPYBYTES UFS doesn't check file devices identity, doesn't give type-change message. Recompiled for create stream * ADIR has TRUEDEVICE * Revert "FILEIO: stream records detected EOL, also RENAMEFILE uses COPYBYTES" This reverts commit fa97aa61575f3ba0876b9ad6aadebf2892a0cb15. * Revert "EXTERNALFORMAT macro and function implement EOL detection" This reverts commit eb098615edbc32961558ec3ba42fdf0d712cafa4. * Revert "LCOMS needing to be recompiled for \CHECKEOLC macro and Create STREAM" This reverts commit 5967452c637861fda6a0e24db32ec387451cc085. * Revert "Added DETECTEDEOLCONVENTION to STREAM declaration" This reverts commit 196f105cf5e536e7d14736863a359fca673d69a4. * Trying to complete the ANY/EOLC and binary RENAMEFILE issues * loadup glitch --- lispusers/COMPARETEXT.LCOM | Bin 11404 -> 11355 bytes lispusers/comparetext | 20 +-- sources/ADIR | 104 +++++++++++----- sources/ADIR.LCOM | Bin 19441 -> 19645 bytes sources/FILEIO | 247 ++++++++++++++++++++++--------------- sources/FILEIO.LCOM | Bin 44943 -> 45833 bytes sources/UFS | 80 ++++++++---- sources/UFS.LCOM | Bin 36619 -> 36584 bytes 8 files changed, 285 insertions(+), 166 deletions(-) diff --git a/lispusers/COMPARETEXT.LCOM b/lispusers/COMPARETEXT.LCOM index 9907241b91729e080b6b41ffd87909b32706ca6a..ef58cdfff31aa6b0b7f2f8eb965a223ea475a115 100644 GIT binary patch delta 258 zcmeB)yd5ziLfBl_B{f;s$iT=%!N|bM#N5iraALNpwuzq_L5ep|O%eQc-Gh zer`c#PHKumYDGcO#IrhqNDB4z^pq61QW8sm(%4KeSJLFtaP#zWbq;cM3~_bAPy}&9 zwJN)bf{BHxh4JJv#yAe3+l&o>=1#0t-OR}3EWo&Iva3+^b+$UQIyKx#ADEPSgxrcaco+|uZ0s!sDLeT&K delta 275 zcmcZ|(Gxi#V)7A2(TTany2hFcTuO!}x?YKSx<&>@CJF`yRz@aPMy5&%Nkys2`MCv| zIjJcM$r*`x>8TS>>sTWx)zi~cQs7ESECDLOVurDSk|vjio2QSfbC9cJh^x!wgNzar zYn9oJ6-+EljV&jaFvf8h8d{l{08IgkGa7CF$LJ!!xP7v-P_%$gIs*`Z32qQ;@?4=H zGgBi4PhV$$-vGxTS3M8MU=IaDV`GJ2*AS2`0U<#OhDJsT?hvl0pPRpep@ES?@MKY8 iH*rIA1s_*G_Ye;SOLGNBzeoj3BL!D~pUo-4-z5OLpGMpO diff --git a/lispusers/comparetext b/lispusers/comparetext index da3fbbe3b..e54e6e250 100644 --- a/lispusers/comparetext +++ b/lispusers/comparetext @@ -1,12 +1,12 @@ (DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10) -(FILECREATED "14-Jan-2024 13:20:30" {WMEDLEY}COMPARETEXT.;133 48539 +(FILECREATED "17-Dec-2024 20:47:21" {WMEDLEY}COMPARETEXT.;134 48583 :EDIT-BY rmk :CHANGES-TO (FNS IMCOMPARE.COLLECT.HASH.CHUNKS) - :PREVIOUS-DATE "14-Jan-2024 13:11:44" {WMEDLEY}COMPARETEXT.;132) + :PREVIOUS-DATE "14-Jan-2024 13:20:30" {WMEDLEY}COMPARETEXT.;133) (PRETTYCOMPRINT COMPARETEXTCOMS) @@ -291,7 +291,8 @@ TITLE TEXTWIDTH TEXTHEIGHT]) (IMCOMPARE.COLLECT.HASH.CHUNKS - [LAMBDA (CHUNK HASH.TYPE) (* ; "Edited 14-Jan-2024 13:20 by rmk") + [LAMBDA (CHUNK HASH.TYPE) (* ; "Edited 17-Dec-2024 20:46 by rmk") + (* ; "Edited 14-Jan-2024 13:20 by rmk") (* ; "Edited 18-Oct-2023 17:45 by rmk") (* ; "Edited 20-Jan-2022 23:09 by rmk") (* ; "Edited 24-Dec-2021 22:30 by rmk") @@ -315,7 +316,6 @@ (OPENTEXTSTREAM STREAM NIL NIL NIL `(OBJECTBYTE ,(CHARCODE *] '(PROGN (CLOSEF? OLDVALUE]) - (SETFILEINFO STREAM 'EOL 'ANY) (CL:UNLESS (fetch (IMCOMPARE.CHUNK CHUNKLENGTH) of CHUNK) (* ;; @@ -780,12 +780,12 @@ GRAPHER) ) (DECLARE%: DONTCOPY - (FILEMAP (NIL (1234 40907 (COMPARETEXT 1244 . 2884) (COMPARETEXT.WINDOW 2886 . 6684) ( + (FILEMAP (NIL (1234 40951 (COMPARETEXT 1244 . 2884) (COMPARETEXT.WINDOW 2886 . 6684) ( COMPARETEXT.TSTREAM 6686 . 9907) (COMPARETEXT.SETSEL 9909 . 10814) (CHUNKNODELABEL 10816 . 11937) ( IMCOMPARE.BOXNODE 11939 . 12915) (IMCOMPARE.CHUNKS 12917 . 17525) (IMCOMPARE.COLLECT.HASH.CHUNKS 17527 - . 20676) (IMCOMPARE.DISPLAYGRAPH 20678 . 28757) (IMCOMPARE.HASH 28759 . 33117) ( -IMCOMPARE.MERGE.CONNECTED.CHUNKS 33119 . 36615) (IMCOMPARE.MERGE.UNCONNECTED.CHUNKS 36617 . 38572) ( -IMCOMPARE.SHOW.DIST 38574 . 39020) (IMCOMPARE.UPDATE.SYMBOL.TABLE 39022 . 40905)) (40908 47392 ( -IMCOMPARE.LEFTBUTTONFN 40918 . 43822) (IMCOMPARE.MIDDLEBUTTONFN 43824 . 46940) (IMCOMPARE.COPYBUTTONFN - 46942 . 47390)) (47445 48136 (TAIL1 47455 . 47809) (TAIL2 47811 . 48134))))) + . 20720) (IMCOMPARE.DISPLAYGRAPH 20722 . 28801) (IMCOMPARE.HASH 28803 . 33161) ( +IMCOMPARE.MERGE.CONNECTED.CHUNKS 33163 . 36659) (IMCOMPARE.MERGE.UNCONNECTED.CHUNKS 36661 . 38616) ( +IMCOMPARE.SHOW.DIST 38618 . 39064) (IMCOMPARE.UPDATE.SYMBOL.TABLE 39066 . 40949)) (40952 47436 ( +IMCOMPARE.LEFTBUTTONFN 40962 . 43866) (IMCOMPARE.MIDDLEBUTTONFN 43868 . 46984) (IMCOMPARE.COPYBUTTONFN + 46986 . 47434)) (47489 48180 (TAIL1 47499 . 47853) (TAIL2 47855 . 48178))))) STOP diff --git a/sources/ADIR b/sources/ADIR index d88e0bedd..3a596d8b2 100644 --- a/sources/ADIR +++ b/sources/ADIR @@ -1,12 +1,12 @@ (DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10) -(FILECREATED " 6-May-2024 15:54:01" {WMEDLEY}ADIR.;45 67756 +(FILECREATED "25-Dec-2024 11:31:30" {MEDLEY}ADIR.;15 70102 :EDIT-BY rmk - :CHANGES-TO (FNS \UPF.DIRECTORY) + :CHANGES-TO (FNS TRUEDEVICE.STUB) - :PREVIOUS-DATE " 4-May-2024 16:25:09" {WMEDLEY}ADIR.;44) + :PREVIOUS-DATE "25-Dec-2024 07:35:38" {MEDLEY}ADIR.;13) (PRETTYCOMPRINT ADIRCOMS) @@ -16,10 +16,12 @@ (FNS DELFILE FULLNAME INFILE INFILEP IOFILE OPENFILE OPENSTREAM OUTFILE OUTFILEP RENAMEFILE SIMPLE.FINDFILE VMEMSIZE \COPYSYS \FLUSHVM \LOGOUT0) (CONSTANTS (MULTIPLE.STREAMS.PER.FILE.ALLOWED T)) + (FNS TRUEDEVICE.STUB) (P (MOVD? 'SIMPLE.FINDFILE 'FINDFILE NIL T) (MOVD? 'EVQ 'TRUEFILENAME) (MOVD? 'EVQ 'PSEUDOFILENAME) - (MOVD? 'NILL 'PSEUDOHOSTP)) + (MOVD? 'NILL 'PSEUDOHOSTP) + (MOVD? 'TRUEDEVICE.STUB 'TRUEDEVICE)) (DECLARE%: DONTEVAL@LOAD DOCOPY (P (* ;; "for the benefit of the call to PATHNAMEP in OPENSTREAM. PATHNAMEP (and pathnames) get defined much later in the loadup.") @@ -197,7 +199,8 @@ (fetch (IFPAGE NActivePages) of \InterfacePage]) (\COPYSYS - [LAMBDA (FILE SYSNAME DONTSAVE) (* ; "Edited 14-Sep-2023 23:19 by rmk") + [LAMBDA (FILE SYSNAME DONTSAVE) (* ; "Edited 18-Dec-2024 13:21 by rmk") + (* ; "Edited 14-Sep-2023 23:19 by rmk") (* ; "Edited 3-Jul-2023 19:21 by rmk") (* ; "Edited 1-Jul-2023 12:34 by rmk") (* ; "Edited 29-Jun-2023 11:41 by rmk") @@ -241,8 +244,7 @@ (SETQ TEMPNAME (COPYFILE (COND (LDEDEST (CONCAT "{DSK}" LDEDEST)) (T "{DSK}~/lisp.virtualmem")) - TARGETFILE - '((TYPE BINARY] + TARGETFILE] (COND ((NULL VAL) (* ; "Continuing in the current image") (CL:WHEN TARGETFILE (RENAMEFILE TEMPNAME TARGETFILE)) @@ -298,6 +300,14 @@ (CONSTANTS (MULTIPLE.STREAMS.PER.FILE.ALLOWED T)) ) +(DEFINEQ + +(TRUEDEVICE.STUB + [LAMBDA (X) (* ; "Edited 25-Dec-2024 11:31 by rmk") + (if (type? FDEV X) + then X + else (\GETDEVICEFROMNAME X NIL T]) +) (MOVD? 'SIMPLE.FINDFILE 'FINDFILE NIL T) @@ -306,6 +316,8 @@ (MOVD? 'EVQ 'PSEUDOFILENAME) (MOVD? 'NILL 'PSEUDOHOSTP) + +(MOVD? 'TRUEDEVICE.STUB 'TRUEDEVICE) (DECLARE%: DONTEVAL@LOAD DOCOPY @@ -317,7 +329,8 @@ (DEFINEQ (UNPACKFILENAME.STRING - [LAMBDA (FILE ONEFIELDFLG DIRFLG OSTYPE PACKFLG CLFLG) (* ; "Edited 4-May-2024 12:45 by rmk") + [LAMBDA (FILE ONEFIELDFLG DIRFLG OSTYPE PACKFLG CLFLG) (* ; "Edited 11-May-2024 21:23 by rmk") + (* ; "Edited 4-May-2024 12:45 by rmk") (* ; "Edited 9-Mar-2024 10:23 by rmk") (* ; "Edited 13-Nov-2023 20:28 by rmk") (* ; "Edited 28-Apr-2022 11:40 by rmk") @@ -467,29 +480,54 @@ THEN (* ;; "DIRECTORY advances over initial duplicate brackets (but DIRSTART could be a subdirectory character instead)") - (CL:WHEN [AND (EQ DIRSTART (SUB1 $$OFFSET)) - (FMEMB (\GETBASECHAR $$FATP $$BASE (SUB1 $$OFFSET - )) - (CHARCODE (> / <] - (SETQ DIRSTART $$OFFSET)) + (SETQ C (CHARCODE >)) + (GO COERCE) + (IF (EQ DIRSTART (SUB1 $$OFFSET)) + THEN (CL:WHEN (FMEMB (\GETBASECHAR $$FATP $$BASE + (SUB1 $$OFFSET)) + (CHARCODE (> / <))) + (SETQ DIRSTART $$OFFSET)) + ELSE + (* ;; + "< in the middle: DIRTY flushes it, alternative is (\ILLEGAL.ARG FILE)") + + (SETQ DIRDIRTY T)) ELSE (SETQ DIRSTART STARTPOS) (* ;;  "DIRSTART updates for duplicates, but NAME may want all the brackets") (SETQ DIRBRKSTART STARTPOS)) + + (* ;; "Borrow DIREND code below if we don't want < after the last > to show up as the first character of the name.") + [SETQ NAMESTART (SETQ NAMEEND (SETQ EXTENSIONSTART (SETQ VERSIONSTART NIL])) ((> /) (* ; "Preceding string is for sure a directory that maybe ends here (unless we're already in an extension") (IF DIRSTART THEN - (* ;; + + (* ;; "> and / in the middle or end of a directory are essentially equivalent: the directory is dirty unless there is exactly one >. A sequence >//>/ reduces at output to a singleton >. It is also dirty if a single occurence is a slash--that is also canonicalized to a single >.") + + (* ;; "It is not clear yet whether < in the middle should be treated in the same way, or whether that should cause an error.") + + (IF (EQ DIRSTART (SUB1 $$OFFSET)) + THEN (CL:WHEN (FMEMB (\GETBASECHAR $$FATP $$BASE (SUB1 + $$OFFSET + )) + (CHARCODE (> / <))) + + (* ;;  "Advance over initial duplicate brackets (but DIRSTART could be a subdirectory character)") - (CL:WHEN [AND (EQ DIRSTART (SUB1 $$OFFSET)) - (FMEMB (\GETBASECHAR $$FATP $$BASE (SUB1 $$OFFSET)) - (CHARCODE (> / <] - (SETQ DIRSTART $$OFFSET)) + (SETQ DIRSTART $$OFFSET)) + ELSEIF (OR (FMEMB (\GETBASECHAR $$FATP $$BASE (SUB1 $$OFFSET)) + (CHARCODE (> /))) + (EQ C (CHARCODE /))) + THEN + (* ;; "Either extending a sequence, or a single slash.") + + (SETQ DIRDIRTY T)) ELSE (SETQ DIRSTART STARTPOS) (SETQ DIRBRKSTART STARTPOS)) (IF DIREND @@ -662,7 +700,8 @@ (PUSH $$VAL F FVAL]) (\UPF.DIRECTORY - [LAMBDA (DIRSTART DIREND DIRDIRTY $$BASE $$FATP $$READONLY)(* ; "Edited 6-May-2024 15:53 by rmk") + [LAMBDA (DIRSTART DIREND DIRDIRTY $$BASE $$FATP $$READONLY)(* ; "Edited 11-May-2024 18:55 by rmk") + (* ; "Edited 6-May-2024 15:53 by rmk") (* ; "Edited 4-May-2024 16:25 by rmk") (* ; "Edited 8-Mar-2024 23:03 by rmk") (* ; "Edited 28-Apr-2022 09:15 by rmk") @@ -691,15 +730,15 @@ DO (ADD DESTPOS 1) (SETQ C (\GETBASECHAR $$FATP $$BASE DIROFF)) (SELCHARQ C - ((> /) + ((> / <) (\PUTBASECHAR $$FATP DESTBASE DESTPOS (CHARCODE >)) (* ;; "Advance past duplicates") (FIND I FROM (ADD1 DIROFF) TO DIREND WHILE (FMEMB (\GETBASECHAR $$FATP $$BASE I) - (CHARCODE (> /))) FINALLY (SETQ DIROFF - (SUB1 I)))) + (CHARCODE (> / <))) FINALLY (SETQ DIROFF + (SUB1 I)))) (\PUTBASECHAR $$FATP DESTBASE DESTPOS C)) FINALLY (REPLACE (STRINGP LENGTH) OF DEST WITH DESTPOS) (RETURN DEST)) @@ -1250,14 +1289,15 @@ (ADDTOVAR LAMA PACKFILENAME.STRING PACKFILENAME) ) (DECLARE%: DONTCOPY - (FILEMAP (NIL (3112 15769 (DELFILE 3122 . 3283) (FULLNAME 3285 . 3652) (INFILE 3654 . 3913) (INFILEP -3915 . 4050) (IOFILE 4052 . 4303) (OPENFILE 4305 . 4608) (OPENSTREAM 4610 . 8950) (OUTFILE 8952 . 9214 -) (OUTFILEP 9216 . 9352) (RENAMEFILE 9354 . 9660) (SIMPLE.FINDFILE 9662 . 10072) (VMEMSIZE 10074 . -10241) (\COPYSYS 10243 . 14488) (\FLUSHVM 14490 . 15562) (\LOGOUT0 15564 . 15767)) (16227 38951 ( -UNPACKFILENAME.STRING 16237 . 36252) (\UPF.DIRECTORY 36254 . 38949)) (40479 42785 (UNPACKFILENAME -40489 . 40675) (LASTCHPOS 40677 . 41371) (FILENAMEFIELD 41373 . 41667) (FILENAMEFIELD.STRING 41669 . -42073) (PACKFILENAME 42075 . 42418) (PACKFILENAME.STRING 42420 . 42783)) (57255 58168 ( -FILEDIRCASEARRAY 57265 . 58166)) (58335 65515 (LOGOUT 58345 . 59262) (MAKESYS 59264 . 60893) (SYSOUT -60895 . 62447) (SAVEVM 62449 . 63249) (HERALD 63251 . 63411) (INTERPRET.REM.CM 63413 . 65138) ( -\USEREVENT 65140 . 65513)) (65697 67424 (USERNAME 65707 . 66663) (SETUSERNAME 66665 . 67422))))) + (FILEMAP (NIL (3201 15904 (DELFILE 3211 . 3372) (FULLNAME 3374 . 3741) (INFILE 3743 . 4002) (INFILEP +4004 . 4139) (IOFILE 4141 . 4392) (OPENFILE 4394 . 4697) (OPENSTREAM 4699 . 9039) (OUTFILE 9041 . 9303 +) (OUTFILEP 9305 . 9441) (RENAMEFILE 9443 . 9749) (SIMPLE.FINDFILE 9751 . 10161) (VMEMSIZE 10163 . +10330) (\COPYSYS 10332 . 14623) (\FLUSHVM 14625 . 15697) (\LOGOUT0 15699 . 15902)) (16033 16269 ( +TRUEDEVICE.STUB 16043 . 16267)) (16637 41297 (UNPACKFILENAME.STRING 16647 . 38483) (\UPF.DIRECTORY +38485 . 41295)) (42825 45131 (UNPACKFILENAME 42835 . 43021) (LASTCHPOS 43023 . 43717) (FILENAMEFIELD +43719 . 44013) (FILENAMEFIELD.STRING 44015 . 44419) (PACKFILENAME 44421 . 44764) (PACKFILENAME.STRING +44766 . 45129)) (59601 60514 (FILEDIRCASEARRAY 59611 . 60512)) (60681 67861 (LOGOUT 60691 . 61608) ( +MAKESYS 61610 . 63239) (SYSOUT 63241 . 64793) (SAVEVM 64795 . 65595) (HERALD 65597 . 65757) ( +INTERPRET.REM.CM 65759 . 67484) (\USEREVENT 67486 . 67859)) (68043 69770 (USERNAME 68053 . 69009) ( +SETUSERNAME 69011 . 69768))))) STOP diff --git a/sources/ADIR.LCOM b/sources/ADIR.LCOM index fbb324e03e20a707c1468607af8992c4d7a13327..5633fc9e15a53d4c33245571f49aab0a399b6780 100644 GIT binary patch delta 1698 zcmZuyTWB0r7~WHhHd`BlS&OMj`**R)Zb{;tx$jbAHaoNK?Cor4W@AEvi!_C1Zve^`*#jeJODq846q{)K?Uj)I2l!A}ee>TBxwhqI&eCNM> zXU=#2xqFs;d!BsqVxOoC7)Or`h=M2srBMlAAqb)1krT(KOO>NjaN<=6!p!N}-Q83P zL$KLi(4vwaRrDbEPgeuSUAtf!=BO1n2OYOC0wwfJ6fzlT_8A-;48qjQZ(!tyVnw2Y z7!3PE2`gj9Z8PSY##W;T1U*7Kr~;Zm1(D|o=q=g95Y5|2h83Iv10!t>7KZ(GFjEBzbI4hc6@vGECa0 zW4dW`e1yep1H_09lktohvz>8gq>unnM<8Q4dDFI;4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2WXLy8YxnV1a}S`k^{#AV@CzYVh{6XzIop_ z@6CR*dIN1QqK{99Kp)MYe`l1)L1`%XVn8#GDFD3u>yI%Rwh45{XDqJO8GT{y!;A3j0DS zJ4cfajhCp^mGp0gI~6^pYM>j2rgMfMy8HMr#EK3bw^`X8wS<&VQagIpV?>L|=HuRa zRn=>vhfkt0zW6jpHU5$hBf`)6j`Yp;h;J{y>U#zK%D?v=teG(7P?wgnw31+P#{xxG zU@DoTamTH=iE;{vDS({q7OCSf2Z%wS=+d&qTAdZ*c?v`q8CJYfvh!31q7iV~8?6K& zis_x)8$l?_>(4Abr>GDLl`2IF3A+$?D&er_-}iejKh-~p-sZRa-$kx>{MnDtoR_cv zGVxxz>Tjmm@$LC#^d}oxV4?Jbdp*}gSi3v(Vx|Q@%+zLH-M+buzFtN@iTTN`mB}WP z#Lg-^CdThr@Z0^&Ukz3dHZN3H6l@oozPqxe%*w3f1fF$(m5x`ldF+ z=K}lo-?^Wz2Ahqw79^xkY~5V$xy8eQ!-rxmy7vbgSs7y?c0kY@FSnqTb^b=+1pgtR zqqq2@zzsCX7lTKU&sz;%-ZMuapN*GT9tc(l6q0Fi$w1_&3{%B&DG_&R%AP0+L>IrM z6TzmibQglfrSHlybkdDzxDz>51gxt(#>J}WphI58dgqep23X>aB`IK{X^>`a2{2X+;pS4= zDS#=I?UW0qVeCX*<1lz;KnF zRexjMTF7S}WPk3tmd|8=Y})mWO5-|D41b`ByWZstrQ0fmboq;5(|h6t?`Urkcpxhy sAOG93__=H!|1jI{gHWE0TVoLN@mpEok<1})o$l%5mr~F3!?`d10qD7=RR910 diff --git a/sources/FILEIO b/sources/FILEIO index cdb7ff6be..244a1fcf7 100644 --- a/sources/FILEIO +++ b/sources/FILEIO @@ -1,12 +1,12 @@ (DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10) -(FILECREATED " 8-Dec-2023 15:17:12" {WMEDLEY}FILEIO.;124 163555 +(FILECREATED "25-Dec-2024 10:56:37" {WMEDLEY}FILEIO.;138 166550 :EDIT-BY rmk - :CHANGES-TO (FNS \GENERIC.CHARSET CHARSET ACCESS-CHARSET) + :CHANGES-TO (FNS SETFILEINFO \DO.PARAMS.AT.OPEN \RENAMEFILE) - :PREVIOUS-DATE " 7-Dec-2023 23:54:02" {WMEDLEY}FILEIO.;121) + :PREVIOUS-DATE "18-Dec-2024 21:08:09" {WMEDLEY}FILEIO.;135) (PRETTYCOMPRINT FILEIOCOMS) @@ -1446,7 +1446,9 @@ (GO RETRY]) (\DO.PARAMS.AT.OPEN - [LAMBDA (STREAM ACCESS PARAMETERS) (* ; "Edited 25-Aug-2023 08:43 by rmk") + [LAMBDA (STREAM ACCESS PARAMETERS) (* ; "Edited 25-Dec-2024 10:54 by rmk") + (* ; "Edited 15-Jul-2024 22:29 by rmk") + (* ; "Edited 25-Aug-2023 08:43 by rmk") (* ; "Edited 6-Jul-2022 00:00 by rmk") (* ; "Edited 19-Dec-2021 09:30 by rmk") (* ; "Edited 14-Dec-2021 16:10 by rmk") @@ -1454,6 +1456,8 @@ (* ; "Edited 29-Jun-2021 17:07 by rmk:") (* ; "Edited 5-Oct-92 13:45 by jds") + (* ;; "RMK: July 2024: Default EOL to ANY on input streams, allow EXTERNAL FORMAT to be a (FORMAT EOL) list so CL:OPEN can get the EOL") + (* ;; "Does generic parameters when a file/stream is open. Called by \OPENFILE and OPENSTREAM") (* ;; "RMK: August 2023: Added PUTSTREAMPROP as last resort.") @@ -1465,31 +1469,60 @@ (DECLARE (USEDFREE STREAM-AFTER-OPEN-FNS)) (\EXTERNALFORMAT STREAM :DEFAULT) - (for X ATTR VAL in PARAMETERS do (COND - [(LISTP X) - (SETQ ATTR (CAR X)) - (SETQ VAL (CAR (LISTP (CDR X] - (T (SETQ ATTR X) - (SETQ VAL T))) - (SELECTQ ATTR - (BUFFERS (SETFILEINFO STREAM 'BUFFERS VAL)) - (ENDOFSTREAMOP (SETFILEINFO STREAM 'ENDOFSTREAMOP VAL)) - (CHARSET (CHARSET STREAM VAL)) - ((FORMAT EXTERNALFORMAT :EXTERNAL-FORMAT) - (\EXTERNALFORMAT STREAM VAL)) - (CONVHANKAKU (CONVHANKAKU STREAM VAL)) - ((EOL EOLCONVENTION EOLC) - (SETFILEINFO STREAM 'EOL VAL)) - (PUTSTREAMPROP STREAM ATTR VAL))) + [for X ATTR VAL EOL in PARAMETERS do [(COND + [(LISTP X) + (SETQ ATTR (CAR X)) + (SETQ VAL (CAR (LISTP (CDR X] + (T (SETQ ATTR X) + (SETQ VAL T))) + (SELECTQ ATTR + (BUFFERS (SETFILEINFO STREAM 'BUFFERS VAL)) + (ENDOFSTREAMOP (SETFILEINFO STREAM 'ENDOFSTREAMOP VAL)) + (CHARSET (CHARSET STREAM VAL)) + ((FORMAT EXTERNALFORMAT :EXTERNAL-FORMAT) + + (* ;; + "VAL can be :UTF-8, CR, (UTF:8 CR), i.e. specify either one or both") + + (if (LISTP VAL) + then (* ; + "VAL could be (:UTF-8 CR) e.g. from CL:OPEN") + (\EXTERNALFORMAT STREAM (CAR VAL)) + (* ; + "Can override the EOL of the format") + (SETQ EOL (CADR VAL)) + elseif (SETQ EOL (CAR) + VAL) + else (\EXTERNALFORMAT STREAM VAL))) + (CONVHANKAKU (CONVHANKAKU STREAM VAL)) + ((EOL EOLCONVENTION EOLC) + (SETQ EOL VAL] finally + + (* ;; + "If not specified, default EOL to ANY--SETFILEINFO checks for output streams") + + (SETFILEINFO STREAM 'EOL + (OR EOL 'ANY] (FOR FN IN STREAM-AFTER-OPEN-FNS DO (APPLY* FN STREAM ACCESS PARAMETERS]) (\RENAMEFILE - [LAMBDA (OLDFILE NEWFILE) (* hdj " 7-May-86 12:22") + [LAMBDA (OLDFILE NEWFILE) (* ; "Edited 25-Dec-2024 10:14 by rmk") + (* ; "Edited 16-Dec-2024 21:07 by rmk") + (* hdj " 7-May-86 12:22") (SETQ OLDFILE (\ADD.CONNECTED.DIR OLDFILE)) (SETQ NEWFILE (\ADD.CONNECTED.DIR NEWFILE)) - (LET ((OLD-DEVICE (\GETDEVICEFROMNAME OLDFILE T)) - (NEW-DEVICE (\GETDEVICEFROMNAME NEWFILE T))) - (AND OLD-DEVICE (FDEVOP 'RENAMEFILE OLD-DEVICE OLD-DEVICE OLDFILE NEW-DEVICE NEWFILE]) + + (* ;; "\GETDEVICEFROMNAME errors if the devices don't exist") + + (LET ((OLD-DEVICE (TRUEDEVICE OLDFILE)) + (NEW-DEVICE (TRUEDEVICE NEWFILE)) + NEWFULLNAME) + (CL:WHEN (SETQ NEWFULLNAME (FDEVOP 'RENAMEFILE OLD-DEVICE OLD-DEVICE (TRUEFILENAME OLDFILE) + NEW-DEVICE + (TRUEFILENAME NEWFILE))) + (CL:IF (PSEUDOHOSTP NEWFILE) + (PSEUDOFILENAME NEWFULLNAME) + NEWFULLNAME))]) (\REVALIDATEFILE [LAMBDA (STREAM) (* bvm%: "30-DEC-81 17:45") @@ -2250,27 +2283,32 @@ update the map") T]) (COPYFILE - [LAMBDA (FROMFILE TOFILE DESTPARAMETERS SOURCEPARAMETERS) + [LAMBDA (FROMFILE TOFILE) - (* ;; - "Edited 8-Jul-2022 10:54 by rmk: Added SOURCEPARAMETERS, in particular to declare external format") + (* ;; "Edited 18-Dec-2024 21:07 by rmk") (* ;; "Edited 8-Jul-2022 10:41 by rmk") (* ;; "Edited 2-Jan-93 13:35 by jds") -(* ;;; "DESTPARAMETERS is like PARAMETERS arg to OPENSTREAM -- overrides default parameters") - - [AND (DIRECTORYNAMEP (PACKFILENAME 'HOST NIL 'BODY TOFILE) - (UNPACKFILENAME TOFILE 'HOST)) - (SETQ TOFILE (PACKFILENAME 'DIRECTORY TOFILE 'BODY (PACKFILENAME 'HOST NIL 'DIRECTORY NIL - 'BODY FROMFILE] + (CL:WHEN (DIRECTORYNAMEP (PACKFILENAME 'HOST NIL 'BODY TOFILE) + (UNPACKFILENAME TOFILE 'HOST)) + (SETQ TOFILE (PACKFILENAME 'DIRECTORY TOFILE 'BODY (PACKFILENAME 'HOST NIL 'DIRECTORY NIL + 'BODY FROMFILE)))) (RESETLST - [RESETSAVE [SETQ FROMFILE (OPENSTREAM FROMFILE 'INPUT 'OLD `((SEQUENTIAL T) - (DON'TCACHE T) - ,@SOURCEPARAMETERS] - '(PROGN (CLOSEF OLDVALUE] - (\COPYOPENFILE FROMFILE TOFILE DESTPARAMETERS))]) + (LET (FROMSTREAM TOSTREAM) + [RESETSAVE [SETQ FROMSTREAM (OPENSTREAM FROMFILE 'INPUT 'OLD `((SEQUENTIAL T) + (DON'TCACHE T] + '(PROGN (CLOSEF? OLDVALUE] + [RESETSAVE [SETQ TOSTREAM (OPENSTREAM TOFILE 'OUTPUT 'NEW + `((SEQUENTIAL T) + (DON'TCACHE T) + (CREATIONDATE ,(GETFILEINFO FROMSTREAM 'CREATIONDATE] + '(AND RESETSTATE (SETQ OLDVALUE (CLOSEF OLDVALUE)) + (DELFILE OLDVALUE] + (COPYBYTES FROMSTREAM TOSTREAM) + (CLOSEF FROMSTREAM) + (CLOSEF TOSTREAM)))]) (\COPYOPENFILE [LAMBDA (INSTREAM NEWNAME DESTPARAMETERS) @@ -2487,8 +2525,9 @@ update the map") STREAM]) (SETFILEINFO - [LAMBDA (FILE ATTRIB VALUE) (* ; "Edited 19-Dec-2021 09:30 by rmk") - (* ; "Edited 29-Jun-2021 17:05 by rmk:") + [LAMBDA (FILE ATTRIB VALUE) (* ; "Edited 25-Dec-2024 10:56 by rmk") + (* ; "Edited 19-Dec-2021 09:30 by rmk") + (* ; "Edited 29-Jun-2021 17:05 by rmk:") (* ; "Edited 11-Dec-95 11:08 by ") (* ; "Edited 27-Mar-89 15:33 by bvm") (LET (FULLNAME DEV) @@ -2503,8 +2542,8 @@ update the map") (CR CR.EOLC) (CRLF CRLF.EOLC) (LF LF.EOLC) - (ANY (CL:WHEN (\GETSTREAM FILE - 'OUTPUT T) + (ANY (CL:UNLESS (EQ 'INPUT (\GETACCESS + FILE)) (ERROR "EOL convention ANY is not allowed for output streams" FILE)) @@ -2605,30 +2644,38 @@ update the map") (add OFF 1]) (\GENERIC.RENAMEFILE - [LAMBDA (OLDDEVICE OLDFILE NEWDEVICE NEWFILE) (* ; "Edited 2-Jul-90 16:03 by nm") - (if (NOT (FDEVOP 'OPENP OLDDEVICE (FULLNAME OLDFILE) - NIL OLDDEVICE)) - then (RESETLST - [RESETSAVE [SETQ OLDFILE (OPENSTREAM OLDFILE 'INPUT 'OLD '((SEQUENTIAL T) - DON'TCACHE] - '(AND RESETSTATE (CLOSEF? OLDVALUE] - [COND - ((SETQ NEWFILE (\COPYOPENFILE OLDFILE NEWFILE)) - (if (\DELETEFILE (CLOSEF OLDFILE)) - then NEWFILE - else (CONDITIONS:RESTART-CASE (CL:ERROR - ' - XCL::FS-RENAMEFILE-SOURCE-COULDNT-DELETE - :PATHNAME OLDFILE) - (DELETE-DESTINATION NIL :CONDITION - XCL::FS-RENAMEFILE-SOURCE-COULDNT-DELETE :REPORT - "Delete the destination file too." (DELFILE NEWFILE - ) - NIL) - (DONT-DELETE-DESTINATION NIL :CONDITION - XCL::FS-RENAMEFILE-SOURCE-COULDNT-DELETE :REPORT + [LAMBDA (OLDDEVICE OLDFILE NEWDEVICE NEWFILE) (* ; "Edited 16-Dec-2024 21:52 by rmk") + + (* ;; "Names and devices are true, not pseudo") + (* ; "Edited 2-Jul-90 16:03 by nm") + (CL:UNLESS (FDEVOP 'OPENP OLDDEVICE (FULLNAME OLDFILE) + NIL OLDDEVICE) (* ; "Can't rename an open file") + (RESETLST + [LET (INSTREAM OUTSTREAM) + [RESETSAVE [SETQ INSTREAM (OPENSTREAM OLDFILE 'INPUT 'OLD '((SEQUENTIAL T) + (DON'TCACHE T] + '(PROGN (CLOSEF? OLDVALUE] + [RESETSAVE [SETQ OUTSTREAM (OPENSTREAM NEWFILE 'OUTPUT 'NEW + `((SEQUENTIAL T) + (DON'TCACHE T) + (CREATIONDATE ,(GETFILEINFO OLDFILE + 'CREATIONDATE] + '(AND RESETSTATE (SETQ OLDVALUE (CLOSEF OLDVALUE)) + (DELFILE OLDVALUE] + (COPYBYTES INSTREAM OUTSTREAM) + (CLOSEF OUTSTREAM) + (if (\DELETEFILE (CLOSEF INSTREAM)) + then (FULLNAME OUTSTREAM) + else (CONDITIONS:RESTART-CASE (CL:ERROR 'XCL::FS-RENAMEFILE-SOURCE-COULDNT-DELETE + :PATHNAME OLDFILE) + (DELETE-DESTINATION NIL :CONDITION + XCL::FS-RENAMEFILE-SOURCE-COULDNT-DELETE :REPORT + "Delete the destination file too." (DELFILE NEWFILE) + NIL) + (DONT-DELETE-DESTINATION NIL :CONDITION + XCL::FS-RENAMEFILE-SOURCE-COULDNT-DELETE :REPORT "Don't delete the destination file. Just returns the destination filename." - NEWFILE])]) + NEWFILE]))]) (\GENERIC.OPENP [LAMBDA (FILENAME ACCESS DEVICE) (* hdj " 6-Oct-86 17:07") @@ -3115,39 +3162,39 @@ update the map") (ADDTOVAR LAMA \IS.NOT.RANDACCESSP \ILLEGAL.DEVICEOP STREAMPROP) ) (DECLARE%: DONTCOPY - (FILEMAP (NIL (27732 31848 (STREAMPROP 27742 . 28176) (GETSTREAMPROP 28178 . 28927) (PUTSTREAMPROP -28929 . 31696) (STREAMP 31698 . 31846)) (31891 35270 (\DEFPRINT.BY.NAME 31901 . 33053) ( -\STREAM.DEFPRINT 33055 . 34963) (\FDEV.DEFPRINT 34965 . 35268)) (35528 40569 (\GETACCESS 35538 . 35992 -) (\SETACCESS 35994 . 40567)) (60795 66764 (\DEFINEDEVICE 60805 . 63121) (\GETDEVICEFROMNAME 63123 . -63596) (\GETDEVICEFROMHOSTNAME 63598 . 64642) (\REMOVEDEVICE 64644 . 65767) (\REMOVEDEVICE.NAMES 65769 - . 66762)) (66804 92336 (\CLOSEFILE 66814 . 67639) (\DELETEFILE 67641 . 67935) (\DEVICEEVENT 67937 . -69707) (\GENERATEFILES 69709 . 70656) (\GENERATENEXTFILE 70658 . 71309) (\GENERATEFILEINFO 71311 . -71772) (\GETFILENAME 71774 . 72163) (\GENERIC.OUTFILEP 72165 . 72635) (\OPENFILE 72637 . 75215) ( -\DO.PARAMS.AT.OPEN 75217 . 77746) (\RENAMEFILE 77748 . 78172) (\REVALIDATEFILE 78174 . 80776) ( -\PAGED.REVALIDATEFILELST 80778 . 82336) (\PAGED.REVALIDATEFILES 82338 . 84057) (\PAGED.REVALIDATEFILE -84059 . 86342) (\BUFFERED.REVALIDATEFILE 86344 . 88630) (\BUFFERED.REVALIDATEFILELST 88632 . 89816) ( -\PRINT-REVALIDATION-RESULT 89818 . 90660) (\TRUNCATEFILE 90662 . 91053) (\FILE-CONFLICT 91055 . 92334) -) (92372 97035 (\GENERATENOFILES 92382 . 94478) (\NULLFILEGENERATOR 94480 . 94724) (\NOFILESNEXTFILEFN - 94726 . 96717) (\NOFILESINFOFN 96719 . 97033)) (97154 99062 (\FILE.NOT.OPEN 97164 . 97677) ( -\FILE.WONT.OPEN 97679 . 98007) (\ILLEGAL.DEVICEOP 98009 . 98291) (\IS.NOT.RANDACCESSP 98293 . 98739) ( -\STREAM.NOT.OPEN 98741 . 99060)) (99197 101495 (\FDEVINSTANCE 99207 . 101493)) (102697 110071 (CNDIR -102707 . 104012) (DIRECTORYNAME 104014 . 108197) (DIRECTORYNAMEP 108199 . 108815) (HOSTNAMEP 108817 . -109624) (\ADD.CONNECTED.DIR 109626 . 110069)) (110116 138395 (\BACKFILEPTR 110126 . 110314) ( -\BACKPEEKBIN 110316 . 110677) (\BACKBIN 110679 . 111030) (BIN 111032 . 111249) (\BIN 111251 . 111528) -(\BINS 111530 . 111816) (BOUT 111818 . 112180) (\BOUT 112182 . 112497) (\BOUTS 112499 . 112810) ( -COPYBYTES 112812 . 116144) (COPYCHARS 116146 . 119812) (COPYFILE 119814 . 120878) (\COPYOPENFILE -120880 . 124079) (\INFER.FILE.TYPE 124081 . 125035) (EOFP 125037 . 125334) (FORCEOUTPUT 125336 . -125583) (\FLUSH.OPEN.STREAMS 125585 . 125941) (CHARSET 125943 . 127302) (ACCESS-CHARSET 127304 . -127832) (GETEOFPTR 127834 . 128084) (GETFILEINFO 128086 . 131279) (\TYPE.FROM.FILETYPE 131281 . 131751 -) (\FILETYPE.FROM.TYPE 131753 . 131932) (GETFILEPTR 131934 . 132186) (SETFILEINFO 132188 . 136294) ( -SETFILEPTR 136296 . 138015) (BOUT16 138017 . 138202) (BIN16 138204 . 138393)) (138498 145152 ( -\GENERIC.BINS 138508 . 138788) (\GENERIC.BOUTS 138790 . 139055) (\GENERIC.RENAMEFILE 139057 . 140888) -(\GENERIC.OPENP 140890 . 142205) (\GENERIC.READP 142207 . 143359) (\GENERIC.CHARSET 143361 . 145150)) -(145153 145492 (\MAP-OPEN-STREAMS 145163 . 145490)) (147347 149427 (\EOF.ACTION 147357 . 147608) ( -\EOSERROR 147610 . 147803) (\GETEOFPTR 147805 . 147987) (\INCFILEPTR 147989 . 148339) (\PEEKBIN 148341 - . 148532) (\SETCLOSEDFILELENGTH 148534 . 148868) (\SETEOFPTR 148870 . 149058) (\SETFILEPTR 149060 . -149425)) (149428 149970 (\FIXPOUT 149438 . 149738) (\FIXPIN 149740 . 149968)) (149971 150537 (\BOUTEOL - 149981 . 150535)) (153433 163297 (\BUFFERED.BIN 153443 . 154295) (\BUFFERED.PEEKBIN 154297 . 155079) -(\BUFFERED.BOUT 155081 . 155941) (\BUFFERED.BINS 155943 . 159628) (\BUFFERED.BOUTS 159630 . 161431) ( -\BUFFERED.COPYBYTES 161433 . 163295))))) + (FILEMAP (NIL (27735 31851 (STREAMPROP 27745 . 28179) (GETSTREAMPROP 28181 . 28930) (PUTSTREAMPROP +28932 . 31699) (STREAMP 31701 . 31849)) (31894 35273 (\DEFPRINT.BY.NAME 31904 . 33056) ( +\STREAM.DEFPRINT 33058 . 34966) (\FDEV.DEFPRINT 34968 . 35271)) (35531 40572 (\GETACCESS 35541 . 35995 +) (\SETACCESS 35997 . 40570)) (60798 66767 (\DEFINEDEVICE 60808 . 63124) (\GETDEVICEFROMNAME 63126 . +63599) (\GETDEVICEFROMHOSTNAME 63601 . 64645) (\REMOVEDEVICE 64647 . 65770) (\REMOVEDEVICE.NAMES 65772 + . 66765)) (66807 94538 (\CLOSEFILE 66817 . 67642) (\DELETEFILE 67644 . 67938) (\DEVICEEVENT 67940 . +69710) (\GENERATEFILES 69712 . 70659) (\GENERATENEXTFILE 70661 . 71312) (\GENERATEFILEINFO 71314 . +71775) (\GETFILENAME 71777 . 72166) (\GENERIC.OUTFILEP 72168 . 72638) (\OPENFILE 72640 . 75218) ( +\DO.PARAMS.AT.OPEN 75220 . 79416) (\RENAMEFILE 79418 . 80374) (\REVALIDATEFILE 80376 . 82978) ( +\PAGED.REVALIDATEFILELST 82980 . 84538) (\PAGED.REVALIDATEFILES 84540 . 86259) (\PAGED.REVALIDATEFILE +86261 . 88544) (\BUFFERED.REVALIDATEFILE 88546 . 90832) (\BUFFERED.REVALIDATEFILELST 90834 . 92018) ( +\PRINT-REVALIDATION-RESULT 92020 . 92862) (\TRUNCATEFILE 92864 . 93255) (\FILE-CONFLICT 93257 . 94536) +) (94574 99237 (\GENERATENOFILES 94584 . 96680) (\NULLFILEGENERATOR 96682 . 96926) (\NOFILESNEXTFILEFN + 96928 . 98919) (\NOFILESINFOFN 98921 . 99235)) (99356 101264 (\FILE.NOT.OPEN 99366 . 99879) ( +\FILE.WONT.OPEN 99881 . 100209) (\ILLEGAL.DEVICEOP 100211 . 100493) (\IS.NOT.RANDACCESSP 100495 . +100941) (\STREAM.NOT.OPEN 100943 . 101262)) (101399 103697 (\FDEVINSTANCE 101409 . 103695)) (104899 +112273 (CNDIR 104909 . 106214) (DIRECTORYNAME 106216 . 110399) (DIRECTORYNAMEP 110401 . 111017) ( +HOSTNAMEP 111019 . 111826) (\ADD.CONNECTED.DIR 111828 . 112271)) (112318 140973 (\BACKFILEPTR 112328 + . 112516) (\BACKPEEKBIN 112518 . 112879) (\BACKBIN 112881 . 113232) (BIN 113234 . 113451) (\BIN +113453 . 113730) (\BINS 113732 . 114018) (BOUT 114020 . 114382) (\BOUT 114384 . 114699) (\BOUTS 114701 + . 115012) (COPYBYTES 115014 . 118346) (COPYCHARS 118348 . 122014) (COPYFILE 122016 . 123325) ( +\COPYOPENFILE 123327 . 126526) (\INFER.FILE.TYPE 126528 . 127482) (EOFP 127484 . 127781) (FORCEOUTPUT +127783 . 128030) (\FLUSH.OPEN.STREAMS 128032 . 128388) (CHARSET 128390 . 129749) (ACCESS-CHARSET +129751 . 130279) (GETEOFPTR 130281 . 130531) (GETFILEINFO 130533 . 133726) (\TYPE.FROM.FILETYPE 133728 + . 134198) (\FILETYPE.FROM.TYPE 134200 . 134379) (GETFILEPTR 134381 . 134633) (SETFILEINFO 134635 . +138872) (SETFILEPTR 138874 . 140593) (BOUT16 140595 . 140780) (BIN16 140782 . 140971)) (141076 148147 +(\GENERIC.BINS 141086 . 141366) (\GENERIC.BOUTS 141368 . 141633) (\GENERIC.RENAMEFILE 141635 . 143883) + (\GENERIC.OPENP 143885 . 145200) (\GENERIC.READP 145202 . 146354) (\GENERIC.CHARSET 146356 . 148145)) + (148148 148487 (\MAP-OPEN-STREAMS 148158 . 148485)) (150342 152422 (\EOF.ACTION 150352 . 150603) ( +\EOSERROR 150605 . 150798) (\GETEOFPTR 150800 . 150982) (\INCFILEPTR 150984 . 151334) (\PEEKBIN 151336 + . 151527) (\SETCLOSEDFILELENGTH 151529 . 151863) (\SETEOFPTR 151865 . 152053) (\SETFILEPTR 152055 . +152420)) (152423 152965 (\FIXPOUT 152433 . 152733) (\FIXPIN 152735 . 152963)) (152966 153532 (\BOUTEOL + 152976 . 153530)) (156428 166292 (\BUFFERED.BIN 156438 . 157290) (\BUFFERED.PEEKBIN 157292 . 158074) +(\BUFFERED.BOUT 158076 . 158936) (\BUFFERED.BINS 158938 . 162623) (\BUFFERED.BOUTS 162625 . 164426) ( +\BUFFERED.COPYBYTES 164428 . 166290))))) STOP diff --git a/sources/FILEIO.LCOM b/sources/FILEIO.LCOM index 64e52f7aa57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Z(!g^{*mSU6#12}3YLF>;?t#!UtqOxM3silwp<#V@U^X(;iadTqF zk7o0A@!zG^^c(J98cwP@fBNb6y{bxK%61$!YC1!vKMIOMV9K$BD)W8M2ZhR_w<(3F zyeEsJtn>S?ZEFB6sxXE9WL~)%`altZZLjEMty?N<&$vXCLK|ITuAyzs0W7~tC^*a= z4J)7&6)2b3Bq+#3L8V5ELW)kJMvfc{Szy1xKtWEKmc@bq6g3|;RZ;Zjd0B?48CG0` z98f`Oae}JyY9xvsjv`Tv9%BQwBj3th*MxZjbp^@WA`;QC+mYM=L4LJ!k5FXeI&C4v zXEfIN`6+JU7gm}-xzW2ccIA8un?d=bw|+|ye*Nvb zSiU&EyMf?qa!vu49cj+h=kZU2K?JVFSSe?j0Sg9^V1Fb#ngsJBvG z>NHaKe-{x9Q|J?c8oAYQYs^y>5!xmQ$o6(YK>0RYl&k&7bfV?Kuw9fX(+cfLmMf!p zBf1QqRXve|N>3HA5AZW~9#X0$QUmh~!ojT^Civ8@Kt_aZBueqtFqJaO0YnlofvS+JG!nZk^1v WWH6FE(=9l>ZOZi&HNE diff --git a/sources/UFS b/sources/UFS index 26c9bf9ec..c2302b716 100644 --- a/sources/UFS +++ b/sources/UFS @@ -1,12 +1,12 @@ (DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10) -(FILECREATED "10-Dec-2024 14:53:34" {WMEDLEY}UFS.;36 78539 +(FILECREATED "18-Dec-2024 12:52:23" {WMEDLEY}UFS.;39 79633 :EDIT-BY rmk - :CHANGES-TO (VARS UFSCOMS) + :CHANGES-TO (FNS \UFSRenameFile) - :PREVIOUS-DATE "16-Sep-2023 09:22:55" {WMEDLEY}UFS.;33) + :PREVIOUS-DATE "16-Sep-2023 09:22:55" {WMEDLEY}UFS.;38) (PRETTYCOMPRINT UFSCOMS) @@ -89,6 +89,8 @@ (HTML . TEXT) (HTM . TEXT) (TEX . TEXT) + (PS . TEXT) + (PDF . TEXT) (DCOM . BINARY) (SKETCH . BINARY) (TEDIT . BINARY) @@ -330,8 +332,36 @@ ) (\UFSRenameFile -(LAMBDA (OLD-DEVICE OLD-NAME NEW-DEVICE NEW-NAME) (* ; "Edited 16-Apr-90 13:46 by nm") (if (NEQ OLD-DEVICE NEW-DEVICE) then (* ;; "Call the generic rename function. ") (LET ((FILE (\GENERIC.RENAMEFILE OLD-DEVICE OLD-NAME NEW-DEVICE NEW-NAME))) (COND ((AND FILE (EQ \MACHINETYPE \MAIKO) FileTypeConfirmFlg) (* ; "print warnig message") (\UFStoOtherRenameMess OLD-DEVICE OLD-NAME NEW-DEVICE NEW-NAME))) FILE) else (* ;; "UNIX file system rename.") (LET ((OLDUNIXNAME (\UFS.RECOGNIZE.FILE OLD-NAME (QUOTE OLD) OLD-DEVICE))) (if (AND OLDUNIXNAME (NOT (\UFS.OPENP OLDUNIXNAME OLD-DEVICE))) then (* ; "Old file is found and not open, so proceed") (LET ((NEWUNIXNAME (\UFS.RECOGNIZE.FILE NEW-NAME (QUOTE NEW) NEW-DEVICE)) (ERRNO (CREATECELL \FIXP))) (COND ((\UFSRenameFile-C (\UFS.REMOVE.HOST.FIELD OLDUNIXNAME OLD-DEVICE) (\UFS.REMOVE.HOST.FIELD NEWUNIXNAME NEW-DEVICE) NEW-DEVICE ERRNO) (\UFS.FULLNAME NEWUNIXNAME NEW-DEVICE)) (T (if (EQL (IPLUS ERRNO 0) 18) then (* ; "CrossDeviceError. Should be PARAMETER!") (\GENERIC.RENAMEFILE OLD-DEVICE OLD-NAME NEW-DEVICE NEW-NAME) else (\UFSError (CONCAT OLDUNIXNAME " or " NEWUNIXNAME) ERRNO) NIL)))))))) -) + [LAMBDA (OLD-DEVICE OLD-NAME NEW-DEVICE NEW-NAME) (* ; "Edited 18-Dec-2024 12:52 by rmk") + (* ; "Edited 16-Apr-90 13:46 by nm") + (if (NEQ OLD-DEVICE NEW-DEVICE) + then + (* ;; "Call the generic rename function. ") + + (\GENERIC.RENAMEFILE OLD-DEVICE OLD-NAME NEW-DEVICE NEW-NAME) + else + (* ;; "UNIX file system rename.") + + (LET ((OLDUNIXNAME (\UFS.RECOGNIZE.FILE OLD-NAME 'OLD OLD-DEVICE))) + (if (AND OLDUNIXNAME (NOT (\UFS.OPENP OLDUNIXNAME OLD-DEVICE))) + then (* ; + "Old file is found and not open, so proceed") + (LET ((NEWUNIXNAME (\UFS.RECOGNIZE.FILE NEW-NAME 'NEW NEW-DEVICE)) + (ERRNO (CREATECELL \FIXP))) + (COND + ((\UFSRenameFile-C (\UFS.REMOVE.HOST.FIELD OLDUNIXNAME OLD-DEVICE) + (\UFS.REMOVE.HOST.FIELD NEWUNIXNAME NEW-DEVICE) + NEW-DEVICE ERRNO) + (\UFS.FULLNAME NEWUNIXNAME NEW-DEVICE)) + (T (if (EQL (IPLUS ERRNO 0) + 18) + then (* ; + "CrossDeviceError. Should be PARAMETER!") + (\GENERIC.RENAMEFILE OLD-DEVICE OLD-NAME NEW-DEVICE + NEW-NAME) + else (\UFSError (CONCAT OLDUNIXNAME " or " NEWUNIXNAME) + ERRNO) + NIL]) (\UFSReadPages (LAMBDA (stream streamFirstPage buffers) (* ; "Edited 3-Mar-89 14:49 by bvm") (* ;;; "ARG0 -- stream : {stream} data type.") (* ;;; "ARG1 -- streamFirstPage : the 1st page number of file to read.") (* ;;; "ARG2 -- buffers : {VMEMPAGEP} or list of {VMEMPAGEP}. ") (* ; "Write out the buffers to the backing file.") (for buffer inside buffers as streamPageNumber from streamFirstPage bind (fileID _ (fetch (UFSSTREAM FILEID) of stream)) lastStreamPage offset ERRNO first (\UPDATEOF stream) (SETQ lastStreamPage (PLUS (fetch (STREAM EPAGE) of stream) (if (EQ 0 (fetch (STREAM EOFFSET) of stream)) then -1 else 0))) (SETQ ERRNO (CREATECELL \FIXP)) sum (if (LEQ streamPageNumber lastStreamPage) then (OR (\UFSReadPages-C fileID streamPageNumber buffer ERRNO) (\UFSError stream ERRNO) (CL:ERROR (QUOTE XCL:SIMPLE-DEVICE-ERROR) :MESSAGE stream)) (if (EQ streamPageNumber lastStreamPage) then (SETQ offset (fetch (STREAM EOFFSET) of stream)) (if (EQ offset 0) then (SETQ offset BYTESPERPAGE) else (\CLEARBYTES buffer offset (- BYTESPERPAGE offset))) offset else BYTESPERPAGE) else (\CLEARWORDS buffer WORDSPERPAGE) 0))) @@ -795,6 +825,8 @@ update the map") (SETQ PAGES (RESTOREMAP STREAM))) (DELETED (* ; "the file disap (HTML . TEXT) (HTM . TEXT) (TEX . TEXT) + (PS . TEXT) + (PDF . TEXT) (DCOM . BINARY) (SKETCH . BINARY) (TEDIT . BINARY) @@ -1152,23 +1184,23 @@ update the map") (SETQ PAGES (RESTOREMAP STREAM))) (DELETED (* ; "the file disap (ADDTOVAR LAMA ) ) (DECLARE%: DONTCOPY - (FILEMAP (NIL (8676 10229 (\UFSCreateDevice 8686 . 9051) (\UFS.CREATE.DEVICE 9053 . 9909) ( -\UFSOpenDevice 9911 . 10088) (\UFSCloseDevice 10090 . 10227)) (14492 50994 (\UFSOpenFile 14502 . 17796 -) (\UFS.OPENP 17798 . 18295) (\UFS.RECOGNIZE.FILE 18297 . 19050) (\UFS.DIRECTORY.NAME 19052 . 19795) ( -\UFSCloseFile 19797 . 21702) (\UFSGetFileName 21704 . 21903) (\UFSDeleteFile 21905 . 22445) ( -\UFSRenameFile 22447 . 23612) (\UFSReadPages 23614 . 24749) (\UFSWritePages 24751 . 25971) ( -\UFSTruncateFile 25973 . 27470) (\UFSDirectoryNameP 27472 . 28526) (\UFSEventFn 28528 . 29190) ( -\UFSGetFileInfo 29192 . 31474) (\UFS.CREATE.PROPS 31476 . 31829) (\UFSSetFileInfo 31831 . 33060) ( -\UFSGenerateFiles 33062 . 39942) (\UFS.NEXTFILEFN 39944 . 47582) (\UFS.FILEINFOFN 47584 . 49033) ( -\UFS.VALID.PROPP 49035 . 49327) (\UFS.REGISTER.GFS 49329 . 49584) (\UFS.UNREGISTER.GFS 49586 . 50169) -(\UFS.ABORT.DIRECTORY 50171 . 50519) (\UFS.ABORT.CL-DIRECTORY 50521 . 50808) (\UFS.CLEANUP.GFS.TABLE -50810 . 50992)) (51029 57713 (\UFSMakeUnixFormatName 51039 . 52060) (\UFSParseNameString 52062 . 52436 -) (\UFSParse-Directory 52438 . 52979) (\UFS.PARSE.BODY 52981 . 53526) (\UFS.ADJUST.HOST 53528 . 53687) - (\UFS.FULLNAME 53689 . 54897) (\UFS.ADD.HOST.FIELD 54899 . 55259) (\UFS.REMOVE.HOST.FIELD 55261 . -56931) (\UFS.HANDLE.RELATIVEDIRECTORY 56933 . 57711)) (58529 59142 (CHDIR 58539 . 59140)) (59214 60200 - (\DEVICEFILE.EOSERROR 59224 . 60198)) (60273 61510 (\UNVISIBLE.PAGED.REVALIDATEFILELST 60283 . 61128) - (\UNVISIBLE.FLUSH.OPEN.STREAMS 61130 . 61508)) (61543 63169 (\UFSError 61553 . 63167)) (63213 65628 ( -\UFSGetFileType 63223 . 63824) (\UFSSetFileType 63826 . 64423) (\UFSeol 64425 . 65626)) (74234 75358 ( -\UFSGetPrintFileType 74244 . 74656) (\UFSGetFileTypeConfirm 74658 . 75106) (\UFSPrintTypeMenu 75108 . -75356)) (75388 78226 (\UFStoOtherCopyMess 75398 . 77076) (\UFStoOtherRenameMess 77078 . 78224))))) + (FILEMAP (NIL (8857 10410 (\UFSCreateDevice 8867 . 9232) (\UFS.CREATE.DEVICE 9234 . 10090) ( +\UFSOpenDevice 10092 . 10269) (\UFSCloseDevice 10271 . 10408)) (14673 52047 (\UFSOpenFile 14683 . +17977) (\UFS.OPENP 17979 . 18476) (\UFS.RECOGNIZE.FILE 18478 . 19231) (\UFS.DIRECTORY.NAME 19233 . +19976) (\UFSCloseFile 19978 . 21883) (\UFSGetFileName 21885 . 22084) (\UFSDeleteFile 22086 . 22626) ( +\UFSRenameFile 22628 . 24665) (\UFSReadPages 24667 . 25802) (\UFSWritePages 25804 . 27024) ( +\UFSTruncateFile 27026 . 28523) (\UFSDirectoryNameP 28525 . 29579) (\UFSEventFn 29581 . 30243) ( +\UFSGetFileInfo 30245 . 32527) (\UFS.CREATE.PROPS 32529 . 32882) (\UFSSetFileInfo 32884 . 34113) ( +\UFSGenerateFiles 34115 . 40995) (\UFS.NEXTFILEFN 40997 . 48635) (\UFS.FILEINFOFN 48637 . 50086) ( +\UFS.VALID.PROPP 50088 . 50380) (\UFS.REGISTER.GFS 50382 . 50637) (\UFS.UNREGISTER.GFS 50639 . 51222) +(\UFS.ABORT.DIRECTORY 51224 . 51572) (\UFS.ABORT.CL-DIRECTORY 51574 . 51861) (\UFS.CLEANUP.GFS.TABLE +51863 . 52045)) (52082 58766 (\UFSMakeUnixFormatName 52092 . 53113) (\UFSParseNameString 53115 . 53489 +) (\UFSParse-Directory 53491 . 54032) (\UFS.PARSE.BODY 54034 . 54579) (\UFS.ADJUST.HOST 54581 . 54740) + (\UFS.FULLNAME 54742 . 55950) (\UFS.ADD.HOST.FIELD 55952 . 56312) (\UFS.REMOVE.HOST.FIELD 56314 . +57984) (\UFS.HANDLE.RELATIVEDIRECTORY 57986 . 58764)) (59582 60195 (CHDIR 59592 . 60193)) (60267 61253 + (\DEVICEFILE.EOSERROR 60277 . 61251)) (61326 62563 (\UNVISIBLE.PAGED.REVALIDATEFILELST 61336 . 62181) + (\UNVISIBLE.FLUSH.OPEN.STREAMS 62183 . 62561)) (62596 64222 (\UFSError 62606 . 64220)) (64266 66681 ( +\UFSGetFileType 64276 . 64877) (\UFSSetFileType 64879 . 65476) (\UFSeol 65478 . 66679)) (75328 76452 ( +\UFSGetPrintFileType 75338 . 75750) (\UFSGetFileTypeConfirm 75752 . 76200) (\UFSPrintTypeMenu 76202 . +76450)) (76482 79320 (\UFStoOtherCopyMess 76492 . 78170) (\UFStoOtherRenameMess 78172 . 79318))))) STOP diff --git a/sources/UFS.LCOM b/sources/UFS.LCOM index ac246dbff6d8e23670f9f318ebd00946f2626790..850c76effcfeabcb18403a5f7175918ea974f099 100644 GIT binary patch delta 635 zcmZvYPm9w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