Skip to content
Prev 14774 / 21318 Next

[Bioc-devel] What is Bioconductor's position on allowing users to create files in the working directory without an explicit path definition in the filename

Guidelines on this topic do not seem to be present in our web
site; there is a link to Wickham's guide but I don't see that it
confronts the topic.  I will make some unofficial and possibly
wrong remarks.

Suppose my function has to create a file "foo.txt".  If I do it
in the working folder, I might destroy a user's cherished file.
So I should check to see if the filename I need is already in use.
If it is, I need to do something graceful.

That's a lot of complexity that may never actually be used.  Can
we avoid it completely?  Here are a few ways to avoid it:

1) Don't create files, just create objects and leave the serialization
task to the user.  You can provide helper functions and documentation but
the details of target location of the serialization are left to the user.

2) If you create a file, use R's tempfile/tempdir discipline to avoid
the need for checking for clobber.  If the content needs to persist the
user should direct this, again with helpers as needed.

3) If you create a file that should persist, use BiocFileCache as that
addresses the location problem and has an added benefit of obligatory
metadata binding.  This is an underused strategy and more pedagogy
is surely in order.  If the user "cannot find" what has been made, there
is a systematic approach available that involves querying the cache.  Your
documentation will supply all relevant details.
On Fri, Mar 22, 2019 at 11:38 AM Koustav Pal <koustav.pal at ifom.eu> wrote: