MathTop

file_exists 函数

检验文件是否存在。

语法

  • FileTools:-Exists(file)
  • file_exists(file)

参数与选项

file要检验的文件名。

示例

  1. 文件存在性fremove('doc_io_exists.txt'); writeline('doc_io_exists.txt', 'ok'); ok := FileTools:-Exists('doc_io_exists.txt'); FileTools:-Remove('doc_io_exists.txt'); ok返回 true。