posix - Using Sys.chmod to toggle world-readability in R -


how can use sys.chmod function in r toggle readability "other", i.e. equivalent of:

chmod o+r myfile chmod o-r myfile 

i want leave other parts of mode alone.

chmod o+r:

mod <- file.info('tmp.txt')$mode sys.chmod('tmp.txt', mod|4) 

chmod o-r:

mod <- file.info('tmp.txt')$mode sys.chmod('tmp.txt', mod&!as.octmode(4)) 

Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -