Code Monkey home page Code Monkey logo

Comments (4)

nathancday avatar nathancday commented on August 23, 2024 1

from boxr.

tamuanand avatar tamuanand commented on August 23, 2024

Hi @rrpaleja

In your example below, are you reading the file folder1/folder2/temp_file.csv via the BoxURL or via the box folder that might be mounted/synched on your laptop?

Hello! Is there a function to read a file using the Box file path? E.g. if the file path is "folder1/folder2/temp_file.csv"

I didn't see one and wrote a quick recursive function to get the file ID from a file path:

library(data.table)
file_path <- 'folder1/folder2/temp_file.csv'

split_file_path <- strsplit(file_path, "/")[[1]]

dir_id_last = box_getwd()
for (i in seq(1,length(split_file_path))) {
   
  ls_list <- box_ls(dir_id = dir_id_last, limit = 1000, fields = 'name')
  dir_id_last <- rbindlist(ls_list)[name == split_file_path[i], id]
    
}

There is probably a better (more efficient and cleaner) way to create this function. Do you think this is something that could be implemented?

Thanks

from boxr.

ijlyttle avatar ijlyttle commented on August 23, 2024

This use case sounds like it would be suited to {boxrdrive}: https://github.com/r-box/boxrdrive - it is based on the path rather than the folder_id.

from boxr.

seth127 avatar seth127 commented on August 23, 2024

Hello. Loving this package, by the way.

I'm looking for the same thing here (specifically, passing a file path to box_ul() and box_dl()). Would there be any interest in me making a PR if I get an implementation that I like? If so, any tips or gotchas to consider in the implementation?

Also, would there be other functions beyond box_ul(), box_dl() (and probably box_ls()) that you would think should have this option?

from boxr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.