Skip to content

Commit

Permalink
OSX gives an error on reading a non-existing file.
Browse files Browse the repository at this point in the history
  • Loading branch information
albert committed Apr 24, 2015
1 parent 20ae835 commit c661277
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 31 deletions.
76 changes: 46 additions & 30 deletions blocks.frt
Original file line number Diff line number Diff line change
Expand Up @@ -1534,38 +1534,38 @@ HEX WANT DROP-WORD
: SHIFT-ARGS ARG$ DROP-WORD DROP ARGS ! ;
DECIMAL

( SRC>EXEC 1 ) CF: ?LI \ AvdH A3mar20

( SRC>EXEC 2 ) CF: ?WIMS \ AvdH B1aug16
HEX
\ Given a source file NAME, return the binary file NAME.
: SRC>EXEC 4 - 2DUP + ".frt" CORA IF 2DROP "a.out" THEN ;
: SRC>EXEC PAD $! PAD $@ + 4 - >R
R@ 4 + R@ 1 + DO I C@ 20 INVERT AND I C! LOOP \ Uppercase
R> ".FRT" CORA IF "AOUT.EXE" ELSE
-4 PAD +! ".EXE" PAD $+! PAD $@ THEN ;
DECIMAL







\
( SRC>EXEC 1 ) CF: ?HS \ AvdH A3mar20

\ Given a source file NAME, return the binary file NAME.
: SRC>EXEC 4 - 2DUP + ".frt" CORA IF 2DROP "a.out" THEN ;





( SRC>EXEC 2 ) CF: \ AvdH B1aug16
HEX
\ Given a source file NAME, return the binary file NAME.
: SRC>EXEC PAD $! PAD $@ + 4 - >R
R@ 4 + R@ 1 + DO I C@ 20 INVERT AND I C! LOOP \ Uppercase
R> ".FRT" CORA IF "AOUT.EXE" ELSE
-4 PAD +! ".EXE" PAD $+! PAD $@ THEN ;
DECIMAL







\
( LOAD-DLL: DLL-ADDRESS: K32 GET-ENV ) CF: ?WI \ AvdH B2aug9
( sc -- adr) : Z 0 , DROP ;
( n adr -- )
Expand Down Expand Up @@ -1886,6 +1886,22 @@ Tools and utilities



( INSTALL-TRAPS ) CF: ?OSX \ AvdH A9sep15
\ Nobody knows how to do this on Bill's systems.
: INSTALL-TRAPS ;
: INSTALL-NO-TRAPS ;












( INSTALL-TRAPS ) CF: ?WIMS \ AvdH A9sep15
\ Nobody knows how to do this on Bill's systems.
: INSTALL-TRAPS ;
Expand Down Expand Up @@ -2574,7 +2590,7 @@ DECIMAL



( OS-IMPORT cdED ) CF: \ AvdH A2feb05
( OS-IMPORT cdED cd ) CF: \ AvdH A2feb05
"SYSTEM" PRESENT 0= ?LEAVE-BLOCK
CREATE cmdbuf 1000 ALLOT
: OS-IMPORT ( sc "name-forth" -- )
Expand All @@ -2587,25 +2603,9 @@ CREATE cmdbuf 1000 ALLOT
?LI WANT -syscalls-
\ Change directory to SC .
: cdED ZEN HERE HERE __NR_chdir XOS ?ERRUR ;
: cd NAME cdED ; \ Change directory to "SC"



( cat cp echo diff grep more ls make man rm ee l unix) CF: ?LI
WANT OS-IMPORT ( and cdED ) \ AvdH A30325
"cat " OS-IMPORT cat
: cd NAME cdED ; \ Change directory to "SC"
"cp " OS-IMPORT cp
"echo " OS-IMPORT echo
"diff " OS-IMPORT diff
"grep " OS-IMPORT grep
"more " OS-IMPORT more
"ls " OS-IMPORT ls
"make " OS-IMPORT make
"man " OS-IMPORT man
"rm -i " OS-IMPORT rm
\ "ee " OS-IMPORT ee \ My favorite editor
"vi " OS-IMPORT ed \ Less favorite editor
"" OS-IMPORT !!
( cat cd cp echo ed more ls rm ee l unix) CF: ?WIMS \ AvdH
WANT OS-IMPORT HEX
"TYPE " OS-IMPORT cat
Expand Down Expand Up @@ -2638,6 +2638,22 @@ DECIMAL "CALL" PRESENT ?LEAVE-BLOCK HEX
"A:" OS-IMPORT A: "C:" OS-IMPORT C: "D:" OS-IMPORT D:

DECIMAL
( cat cp echo diff grep more ls make man rm ee l unix) CF: ?HS
WANT OS-IMPORT ( and cdED ) \ AvdH A30325
"cat " OS-IMPORT cat
"cp " OS-IMPORT cp
"echo " OS-IMPORT echo
"diff " OS-IMPORT diff
"grep " OS-IMPORT grep
"more " OS-IMPORT more
"ls " OS-IMPORT ls
"make " OS-IMPORT make
"man " OS-IMPORT man
"rm -i " OS-IMPORT rm
\ "ee " OS-IMPORT ee \ My favorite editor
"vi " OS-IMPORT ed \ Less favorite editor
"" OS-IMPORT !!

( DEVELOP EDITOR ME ) CF: ?WIMS \ AvdH A9oct05


Expand Down
11 changes: 10 additions & 1 deletion ci86.gnr
Original file line number Diff line number Diff line change
Expand Up @@ -7870,7 +7870,16 @@ dnl This may fail the first time the test runs
enddoc)
_HOSTED_X_({
_HEADER({OPEN-FILE},{OFILE},{DOCOL})
DC TOR, ZEN, FROMR, X
DC TOR, ZEN, FROMR
_HOSTED_OSX_({
DC TDUP, ZERO
DC LIT, access, XOS, LDUP
_0BRANCH({OFIL1})
DC NEGATE, NIP, EXIT
OFIL1:
DC DROP
})_C{}_END_({_HOSTED_OSX_})
DC X
DC LIT, open, XOS
DC LDUP, ZERO, MIN
DC SEMIS
Expand Down
1 change: 1 addition & 0 deletions constant_osx.m4
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ creat EQU 0x8
unlink EQU 0xa
chdir EQU 0xc
read EQU 0x3
access EQU 0x21
select EQU 0x52
_newselect EQU 0x5d ; Spykerman
; _newselect EQU 0x8e
Expand Down

0 comments on commit c661277

Please sign in to comment.