- FILE_BASENAME:去除文件的目录,扩展名等,例:
- PRINT, FILE_BASENAME('/usr/local/itt/idl/lib/dist.pro', '.pro')
- IDL prints:
- dist
- FILE_CHMOD, 'moose.dat', '664'o
- FILE_COPY, 'myroutine.pro', 'myroutine.pro.backup'
- FILE_DELETE, 'moose'
temp = DIST(4) ; Ensure that DIST is compiled
PRINT, FILE_DIRNAME((ROUTINE_INFO('DIST', $
/FUNCTION, /SOURCE)).path)
Depending on the platform and location where IDL is installed, IDL prints something like:
/usr/local/itt/idl/lib
- 得到一个不依赖于平台的完整的路径,等效于file_search中的/FULLY_QUALIFY_PATH关键字
- 文件的行数,很有用。
- 支持通配符
- 判断文件是否存在,应该可以替代exist程序