You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "thisisnic (via GitHub)" <gi...@apache.org> on 2023/08/01 11:12:52 UTC

[GitHub] [arrow] thisisnic commented on a diff in pull request #36851: GH-36714: [R] Create user-friendly wrappers around existing S3 functionality

thisisnic commented on code in PR #36851:
URL: https://github.com/apache/arrow/pull/36851#discussion_r1280475608


##########
r/R/filesystem.R:
##########
@@ -683,3 +683,54 @@ read_file_utf8 <- function(file) {
   Encoding(res) <- "UTF-8"
   res
 }
+
+#' @export
+fs_ls <- function(fs, path, ...){
+  fs$ls(path, ...)
+}
+
+#' @export
+fs_create_dir <- function(fs, path, recursive = TRUE){
+  fs$CreateDir(path, recursive = recursive)
+}
+
+#' @export
+fs_delete_dir <- function(fs, path){
+  fs$DeleteDir(path)
+}
+
+#' @export
+fs_copy_file <- function(fs, src, dest){
+  fs$CopyFile(src, dest)
+}
+
+#' @export
+fs_open_output_stream <- function(fs, path, append = FALSE){
+  if (append) {
+    fs$OpenAppendStream(path)
+  } else {
+    fs$OpenOutputStream(path)
+  }
+}
+
+# TODO: create method close.OutputStream (or whatever object returned from bucket$OpenAppendStream)

Review Comment:
   This won't work and is mixing approaches



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org