【发布时间】:2018-10-14 13:11:33
【问题描述】:
我知道insert-file-contents成语:
(defun read-lines (filePath)
(with-temp-buffer
(insert-file-contents filePath)
(split-string (buffer-string) "\n" t)))
但是有没有更自然的方法来逐行读取文件而不是一次读取整个文件?我正在寻找类似fopen/fread 的功能。
【问题讨论】:
-
我要注意的是,您可以将 BEG 和 END 参数传递给
insert-file-contents以仅插入文件的一部分。不是您要的,但值得指出。