Ruby 如何设置一个目录的权限和时间戳以匹配其他目录?
给定目录Ruby 如何设置一个目录的权限和时间戳以匹配其他目录?,ruby,filesystems,stat,Ruby,Filesystems,Stat,给定目录/a和/b如何使用ruby将/b的权限和时间戳设置为与/a相同?触摸命令(至少在Linux上)具有-r选项: -r, --reference=FILE use this file’s times instead of current time 您可以从Ruby程序中调用touch,以执行所需操作。chmod命令具有类似的标志
/a
和/b
如何使用ruby将/b
的权限和时间戳设置为与/a
相同?触摸命令(至少在Linux上)具有-r
选项:
-r, --reference=FILE
use this file’s times instead of current time
您可以从Ruby程序中调用touch
,以执行所需操作。chmod
命令具有类似的标志