![从 Chrome 下载时 OS/X 上的默认权限](https://linux22.com/image/1436590/%E4%BB%8E%20Chrome%20%E4%B8%8B%E8%BD%BD%E6%97%B6%20OS%2FX%20%E4%B8%8A%E7%9A%84%E9%BB%98%E8%AE%A4%E6%9D%83%E9%99%90.png)
当我从 Chrome 下载图像或文件时,其他组没有读取权限。
是否可以改变这一点,或者是否有办法让特定文件夹中的所有文件继承文件夹权限?
答案1
找到该文件,然后突出显示它并使用以下快捷方式:CMD-I。这将为您提供该文件的信息。在“获取信息”窗口的底部附近,应该有一个权限选项卡。添加您想要选择的用户/组。另一个选项是使用以下脚本,
好的,有几种方法可以做到这一点,尽管我跳过了独立脚本,因为那不会节省任何击键。如果您愿意的话,我还包括了 Unixy 的优点(只需根据需要更改注释语句):
//1)此脚本将更改Finder中选择的文档文件的权限-您可以将其放在Finder工具栏中:
tell application "Finder"
set these_items to the selection
repeat with some_item in these_items
if class of some_item is document file then -- don't change folders, etc
-- do shell script "chmod +w " & quoted form of POSIX path of (some_item as text)
set owner privileges of some_item to read write
end if
end repeat
end tell
//2)将此文件夹操作附加到文件夹,以便添加到该文件夹的任何文件都会获得权限更改:
on adding folder items to this_folder after receiving these_items
repeat with some_item in these_items
-- do shell script "chmod +w " & quoted form of POSIX path of (some_item as text)
tell application "Finder" to set owner privileges of some_item to read write
end repeat
结束添加文件夹项目至