此代碼生成錯誤上的文件:WRITE_FILE(文件名,數據,[附加]),二郎生成錯誤上的文件:WRITE_FILE(文件名,數據,[附加])
{{badmatch,{錯誤,ENOENT} },[{T,保存,2,[{文件, 「1.erl」},{線,38}]}]}
case file:read_file_info(Filename) of
{error, Reason} ->
{ok, IoDevice}=file:open(Filename, [write, binary]),
file:write_file(Filename, Data, [append]), % line 38
file:close(Filename),
ok;
{ok, FileInfo} -> ok
end.
這是錯誤?
感謝它的工作 – user3572870