Programming/lisp2013. 1. 17. 18:50
C언어로 치면 feopn() / fclose() / fseek() / fread()

xlisp.exe의 경로에 생성됨.
ubuntu의 clisp는 실행된 "현재경로"에 생성됨.
> (setq out-stream (open "my-temp-file"))                    
error: file does not exist - "my-temp-file"                  
1> (setq out-stream (open "my-temp-file" :direction :output))
#<Character-Output-Stream 4:"my-temp-file">                  
1> (close out-stream)                                        
t                                                            
1> (setq out-stream (open "my-temp-file"))                   
#<Character-Input-Stream 4:"my-temp-file">                   
1> (close out-stream)                                        
t                                                            
1>                                                            

[링크 : http://psg.com/~dlamkins/sl/chapter03-11.html]

open a file stream
(open <fname> &key :direction :element-type :if-exists :if-does-not-exist)

close a file stream
(close <stream>)

check for existance of a file
(probe-file <fname>)

delete a file
(delete-file <fname>)

get length of file
(file-length <stream>)

get or set file position
(file-position <stream> [<expr>])

read a byte from a stream
(read-byte <stream>[<eofp>[<eof>]])

write a byte to a stream
(write-byte <byte> <stream>)

'Programming > lisp' 카테고리의 다른 글

lisp rem, mod  (0) 2013.01.17
lisp i/o  (0) 2013.01.17
lisp savefun / load  (0) 2013.01.16
xlisp  (0) 2013.01.16
lisp 연관리스트  (0) 2013.01.14
Posted by 구차니