Erlang - is_file



此方法用於確定檔案是否確實是檔案。此方法是 filelib 庫的一部分。

語法

is_file(filename)

引數

  • filename − 這是需要確定其是否為檔案的檔名。

返回值

如果檔案存在並且確實是檔案,則返回 True。

例如

-module(helloworld). 
-export([start/0]). 

start() -> 
   io:fwrite("~p~n",[filelib:is_file("Renamedfile.txt")]).

輸出

如果檔案存在,則輸出為 true

erlang_file_input_output.htm
廣告

© . All rights reserved.