当 File 传递给 Args 对象而不使用 map_each 函数时,它会通过获取其 path 字段的值转换为字符串。
成员
- basename
- dirname
- extension
- is_directory
- is_source
- is_symlink
- owner
- path
- root
- short_path
- tree_relative_path
basename
string File.basename
dirname
string File.dirname
extension
string File.extension
is_directory
bool File.is_directory
is_source
bool File.is_source
is_symlink
bool File.is_symlink
owner
Label File.owner
None。
path
string File.path
short_path。根目录可能为空,对于非生成的文件通常为空。对于生成的文件,它通常包含特定于配置的路径片段,用于对构建该文件时使用的目标 CPU 架构等内容进行编码。如果文件位于二进制文件的运行文件中,请使用 short_path 作为文件映射到的路径。
root
root File.root
short_path
string File.short_path
tree_relative_path
string File.tree_relative_path
tree_relative_path 仅适用于操作命令中目录的展开文件,即 Args.add_all()。对于其他类型的文件,访问此字段会出错。