如果在不使用 map_each
函数的情况下将 File
传递给 Args
对象,系统会通过获取其 path
字段的值将其转换为字符串。
成员
basename
string File.basename
dirname
string File.dirname
扩展程序
string File.extension
is_directory
bool File.is_directory
is_source
bool File.is_source
所有者
Label File.owner
None
。
路径
string File.path
short_path
。根目录可以是空的,对于非生成的文件,通常就是空的。对于生成的文件,它通常包含特定于配置的路径片段,用于编码构建该文件时所用的目标 CPU 架构等内容。如果文件位于二进制文件的 runfile 中,请使用 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())中目录的展开文件。对于其他类型的文件,访问此字段会出错。