Unix Resolution Installation Speed

Is there a significant difference in speed between adding / subtracting permission and setting it explicitly?

For instance:

chmod a+r

against

chmod 755
+4
source share
1 answer

Yes, there is a difference. Absolute configuration requires one system call ( chmod()). An incremental parameter requires two calls: one to obtain the current permissions ( stat()), and then chmod()to set them. A system call chmod()only works in absolute settings.

" ", , . , stat() , โ€‹โ€‹ chmod() . , , WAN, , .

+5

Source: https://habr.com/ru/post/1546586/


All Articles