Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,5 @@
|
|||
(with-open-file (in #p"input.txt" :direction :input)
|
||||
(with-open-file (out #p"output.txt" :direction :output)
|
||||
(loop for line = (read-line in nil 'foo)
|
||||
until (eq line 'foo)
|
||||
do (write-line line out))))
|
||||
12
Task/File-input-output/Common-Lisp/file-input-output-2.lisp
Normal file
12
Task/File-input-output/Common-Lisp/file-input-output-2.lisp
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
(defconstant +buffer-size+ (expt 2 16))
|
||||
|
||||
(with-open-file (in #p"input.txt" :direction :input
|
||||
:element-type '(unsigned-byte 8))
|
||||
(with-open-file (out #p"output.txt"
|
||||
:direction :output
|
||||
:element-type (stream-element-type in))
|
||||
(loop with buffer = (make-array +buffer-size+
|
||||
:element-type (stream-element-type in))
|
||||
for size = (read-sequence buffer in)
|
||||
while (plusp size)
|
||||
do (write-sequence buffer out :end size))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue