🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
```erlang file utilities, such as wildcard matching of filenames filelib:ensure_dir( "test/c/a.txt" ). %在pwd()目录下查看是否存在存在该目录,如果不存在新建目录,不新建文件 filelib:file_size( "text.txt" ). 127 filelib:is_dir( "test/c" ). true filelib:is_dir( "text.txt" ). false filelib:is_file("test/c/"). true filelib:is_file("text.txt").true filelib:is_regular("log/ssl.log"). true filelib:is_regular("log/"). false filelib:last_modified("log/ssl.log"). {{2015,10,29},{17,51,38}} filelib:wildcard("log/*"). ["log/ssl.log"] filelib:wildcard("lib/*/ebin/*.beam"). filelib:wildcard("lib/*/src/*.?rl") filelib:wildcard("lib/*/src/*.{erl,hrl}") filelib:wildcard("lib/*/{src,include}/*.hrl"). filelib:wildcard("lib/*/{src,include}/*.{erl,hrl}") filelib:wildcard("lib/**/*.{erl,hrl}") ? %Matches one character. * %Matches any number of characters up to the end of the filename, the next dot, or the next slash. ** %Two adjacent *'s used as a single pattern will match all files and zero or more directories and subdirectories. [Character1,Character2,...] %Matches any of the characters listed. Two characters separated by a hyphen will match a range of characters. Example: [A-Z] will match any uppercase letter. {Item,...} %Alternation. Matches one of the alternatives. filelib:wildcard("log/*", Cmd::dirname()). ```