-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathadjust-path.fs
More file actions
21 lines (18 loc) · 763 Bytes
/
adjust-path.fs
File metadata and controls
21 lines (18 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
\ adjust pathes 22jun98py
include fileop.fb
DOS also fileop also minos also
: adjust-path-id ( addr-id u1 addr-path u2 addr-file u3 -- )
2dup r/w open-file throw >r
s" tmp.ini" r/w output-file
BEGIN scratch $100 r@ read-line throw WHILE
scratch over 5 min s" Path " compare 0=
IF drop .' Path "'
pathsep emit 2over type '" emit
ELSE scratch over dup 7 - /string s" date-id" compare
0= IF drop >r >r
.' s" ' 2over type .' " date-id'
r> r>
ELSE scratch swap type THEN
THEN cr
REPEAT drop eot r> close-file throw
s" tmp.ini" 2swap cp 0" tmp.ini" fdelete drop 2drop 2drop ;