Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
56
Task/File-input-output/Action-/file-input-output.action
Normal file
56
Task/File-input-output/Action-/file-input-output.action
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
INCLUDE "D2:IO.ACT" ;from the Action! Tool Kit
|
||||
|
||||
PROC Dir(CHAR ARRAY filter)
|
||||
BYTE dev=[1]
|
||||
CHAR ARRAY line(255)
|
||||
|
||||
Close(dev)
|
||||
Open(dev,filter,6)
|
||||
DO
|
||||
InputSD(dev,line)
|
||||
PrintE(line)
|
||||
IF line(0)=0 THEN
|
||||
EXIT
|
||||
FI
|
||||
OD
|
||||
Close(dev)
|
||||
RETURN
|
||||
|
||||
PROC CopyFile(CHAR ARRAY src,dst)
|
||||
DEFINE BUF_LEN="1000"
|
||||
BYTE in=[1], out=[2]
|
||||
BYTE ARRAY buff(BUF_LEN)
|
||||
CARD len
|
||||
|
||||
Close(in)
|
||||
Close(out)
|
||||
Open(in,src,4)
|
||||
Open(out,dst,8)
|
||||
|
||||
DO
|
||||
len=Bget(in,buff,BUF_LEN)
|
||||
IF len>0 THEN
|
||||
Bput(out,buff,len)
|
||||
FI
|
||||
UNTIL len#BUF_LEN
|
||||
OD
|
||||
|
||||
Close(in)
|
||||
Close(out)
|
||||
RETURN
|
||||
|
||||
PROC Main()
|
||||
CHAR ARRAY filter="D:*.*",
|
||||
src="D:INPUT.TXT", dst="D:OUTPUT.TXT"
|
||||
|
||||
Put(125) PutE() ;clear screen
|
||||
|
||||
PrintF("Dir ""%S""%E",filter)
|
||||
Dir(filter)
|
||||
|
||||
PrintF("Copy ""%S"" to ""%S""%E%E",src,dst)
|
||||
CopyFile(src,dst)
|
||||
|
||||
PrintF("Dir ""%S""%E",filter)
|
||||
Dir(filter)
|
||||
RETURN
|
||||
Loading…
Add table
Add a link
Reference in a new issue