博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
FILE_TEST IDL
阅读量:2442 次
发布时间:2019-05-10

本文共 5054 字,大约阅读时间需要 16 分钟。

The FILE_TEST function checks files for existence and other attributes without having to first open the file.

Examples


To determine whether your IDL distribution supports the Intel-based Macintosh operating system:

result = (!DIR + '/bin/bin.darwin.i386', /DIRECTORY) , 'Intel-Mac Installed: ', result ? 'yes' : 'no'

Syntax


Result = FILE_TEST( File [, / | ,  / | , / | , / | ,  / | , /] [, =variable] [, /] )

UNIX-Only Keywords: [, / | , / | , / | , / | , / | , / | , / | , / | , / | , / | , /]

Return Value


FILE_TEST returns 1 (true), if the specified file exists and all of the attributes specified by the keywords are also true. If no keywords are present, a simple test for existence is performed. If the file does not exist or one of the specified attributes is not true, then FILE_TEST returns 0 (false).

Arguments


File

A scalar or array of file names to be tested. The result is of type integer with the same number of elements as File.

Note: Windows platforms have a file name length limit of 260 characters, while Unix platforms have a limit of 1024 characters. File names longer than this limit will return 0 (false).

Keywords


BLOCK_SPECIAL

This keyword is only available on UNIX platforms.

Set this keyword to return 1 (true) if File exists and is a block special device.

CHARACTER_SPECIAL

This keyword is only available on UNIX platforms.

Set this keyword to return 1 (true) if File exists and is a character special device.

DANGLING_SYMLINK

This keyword is only available on UNIX platforms.

Set this keyword to return 1 (true) if File is a symbolic link that points at a non-existent file.

DIRECTORY

Set this keyword to return 1 (true) if File exists and is a directory.

EXECUTABLE

Set this keyword to return 1 (true) if File exists and is executable. The source of this information differs between operating systems:

  • UNIX: IDL checks the per-file information (the execute bit) maintained by the operating system.
  • Microsoft Windows: The determination is made on the basis of the file name extension (e.g. .exe).

GET_MODE

Set this keyword to a named variable to receive the UNIX style mode (permission) mask for the specified file. The bits in these masks correspond to those used by the UNIX chmod(2) system call, and are explained in detail in the description of the Mode argument to the  procedure. When interpreting the value returned by this keyword, the following platform specific details should be kept in mind:

  • The setuid, setgid, and sticky bits are specific to the UNIX operating system, and will never be returned on any other platform. Consult the chmod(2) man page and/or other UNIX programming documentation for more details.
  • The Microsoft Windows operating system does not have 3 permission classes like UNIX does. Therefore, IDL returns the same settings for all three classes.
  • The Microsoft Windows operating system does not maintain an execute bit for files, but instead uses the file suffix to decide if a file is executable.

GROUP

This keyword is only available on UNIX platforms.

Set this keyword to return 1 (true) if File exists and belongs to the same effective group ID (GID) as the IDL process.

NAMED_PIPE

This keyword is only available on UNIX platforms.

Set this keyword to return 1 (true) if File exists and is a named pipe (fifo) device.

NOEXPAND_PATH

Set this keyword to cause FILE_TEST to use the File argument exactly as specified, without applying the usual file path expansion.

READ

Set this keyword to return 1 (true) if File exists and is readable by the user.

REGULAR

Set this keyword to return 1 (true) if File exists and is a regular disk file and not a directory, pipe, socket, or other special file type.

SETGID

This keyword is only available on UNIX platforms.

Set this keyword to return 1 (true) if File exists and has its Set-Group-ID bit set.

SETUID

This keyword is only available on UNIX platforms.

Set this keyword to return 1 (true) if File exists and has its Set-User-ID bit set.

SOCKET

This keyword is only available on UNIX platforms.

Set this keyword to return 1 (true) if File exists and is a UNIX domain socket.

STICKY_BIT

This keyword is only available on UNIX platforms.

Set this keyword to return 1 (true) if File exists and has its sticky bit set.

SYMLINK

This keyword is only available on UNIX platforms.

Set this keyword to return 1 (true) if File exists and is a symbolic link that points at an existing file.

USER

This keyword is only available on UNIX platforms.

Set this keyword to return 1 (true) if File exists and belongs to the same effective user ID (UID) as the IDL process.

WRITE

Set this keyword to return 1 (true) if File exists and is writable by the user.

ZERO_LENGTH

Set this keyword to return 1 (true) if File exists and has zero length.

Note: The length of a directory is highly system dependent and does not necessarily correspond to the number of files it contains. In particular, it is possible for an empty directory to report a non-zero length. Avoid using the ZERO_LENGTH keyword on directories, as the information returned cannot be used in a meaningful way.

转载地址:http://gtiqb.baihongyu.com/

你可能感兴趣的文章
ubuntu中如何启用仓库_如何在Ubuntu中启用本地菜单
查看>>
outlook密码更改_如何更改您的Outlook.com密码
查看>>
如何在Ubuntu 14.04中管理启动应用程序
查看>>
如何在Ubuntu 14.04中读取MOBI文件
查看>>
计算两张图片是否完全相同_您如何分辨两张DVD是否完全相同?
查看>>
如何在Windows 10中连接到无线网络
查看>>
proxies中的机密信息_新机密模式在Gmail中的工作方式
查看>>
如何检查MacBook的电池状况
查看>>
2k分辨率显示器 浏览器_如何使浏览器使用显示器的完整分辨率?
查看>>
ubuntu lts 版本_最新的Ubuntu LTS版本是什么?
查看>>
苹果收集到月中蜂窝数据满_苹果不会收集有关您的大量数据
查看>>
redis发布订阅数据太大_一切现在都是订阅,而且太多了
查看>>
android alexa_如何将Alexa设置为Android上的默认数字助理
查看>>
2018年4月13日_如何立即获取Windows 10的2018年4月更新
查看>>
电报机器人 gmail_如何在新的Gmail中查找联系人
查看>>
硬盘未分配空间变为可用空间_使用Windows 10的新“可用空间”工具清理硬盘
查看>>
如何下载所有Instagram照片
查看>>
iphone闪存测速软件_如何在iPhone上使用USB闪存盘
查看>>
传智播客客户端密码_适用于Android的最佳播客客户端
查看>>
24/7专业家庭安全监控值得吗?
查看>>