You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that when using write_feather in R, it does not follow system-level umask settings.
When writing files using write_feather with a Sys.umask setting of 002, they appear to write files with rw-r--r-- permissions, which I would associate with a umask of 022. When I write files immediately after that while using write.csv, they write appropriately with rw-rw-r-- permissions.
I applied basically the same tests that were used in this issue (similar behavior that was happening with fwrite) Rdatatable/data.table#2049
We had the same problem (feather_0.3.1 as well) and solved it with this workaround:
#' Obtain the chmod octal number from umask.#'#' @details Applies https://en.wikipedia.org/wiki/Umask#Mask_effect.#' Note that newly created files should not be executable#' even if umask says so. https://en.wikipedia.org/wiki/Umask#Exceptions#' Use the boolean executable argument to control behaviour.#' #' @examples Sys.chmod(path, chmod_from_umask())#' @exportchmod_from_umask<-function(umask= Sys.umask(), executable=FALSE){
umask<- unlist(strsplit(stringr::str_pad(umask, 3, pad='0'), split=''))
bitop<-function(i) {
packBits(intToBits(7)
&!intToBits(i)
&!intToBits(!executable),
type='integer')
}
paste(sapply(umask, bitop), collapse='')
}
#' Wrapper around write_feather that obeys sys.umask#' #' This function is necessary, because #' \code{feather::write_feather} does not obey sys.umask#' \url{https://github.com/wesm/feather/issues/323}#' @exportwrite_feather<-function(x, path){
feather::write_feather(x, path)
Sys.chmod(path, chmod_from_umask())
}
If you can reproduce this issue with the Feather implementation in arrow please open a JIRA issue with the Arrow project at http://issues.apache.org/jira. We're working to change feather to use arrow internally
It appears that when using write_feather in R, it does not follow system-level umask settings.
When writing files using write_feather with a Sys.umask setting of 002, they appear to write files with rw-r--r-- permissions, which I would associate with a umask of 022. When I write files immediately after that while using write.csv, they write appropriately with rw-rw-r-- permissions.
I applied basically the same tests that were used in this issue (similar behavior that was happening with fwrite) Rdatatable/data.table#2049
sessionInfo()
The text was updated successfully, but these errors were encountered: