dipterix / filearray

Out-of-memory Arrays in R
https://dipterix.org/filearray/
17 stars 2 forks source link

Ideal way to copy a filearray #8

Closed talegari closed 3 months ago

talegari commented 4 months ago

Hi @dipterix,

Thanks for this great package! What is the ideal way to create a copy of filearray? (not reference, actual copy on disk)

Right now, this works:

fs::dir_copy(fa_obj$.filebase, "newfile")
filearray_load("newfile")

Would it be better to provide a copy method to filearray class?

dipterix commented 4 months ago

You are doing great.

Copying the folder will be sufficient & necessary. Basically filearray stores data into partitions with one or multiple header files (usually just one), in the same portable folder. This structure will unlikely to change in the future.

I'm a little bit hesitated to add native support to copy the arrays. The original purpose for this package is that I can create a filearray object and access (readonly) from multiple R programs for parallel computing, rather than copying multiple GB of files/data around. Is there any reason for you to do this?

dipterix commented 3 months ago

Juse realized filearray_bind(x, filebase = "new/path", symlink = FALSE) should do the work