1,直接获取当前文件夹的路径:
(print (probe-file ".") )
2.或许打开文件的大小:
(let ((file (open "hello.c" :if-does-not-exist nil)))
(print (file-length file))
(close file)
)
3.获取打开文件中的内容
(let ((in (open "hello.c" :if-does-not-exist nil)))
(when in
(loop for line = (read-line in nil)
while line do (format t "~a~%" line))
(close in))
4.判断文件是否存在:
(print (probe-file "hello.c") )