Skip to content
Prev 2186 / 12125 Next

[R-pkg-devel] creating indelible file during unit test

Thanks for the replies to my question.

My function uses first list.files() to select the relevant files and
then file.remove() to delete them.

Redefining file.remove() doesn't work in case of a package due to
lexical scoping. Otherwise this would be a simple and portable
solution.

Having a Linux only solution is better than no solution at all. And it
should be sufficient. Note that I had to use Sys.chmod("test",
mode="0400") instead of Sys.chmod("test", mode="0000") because
list.files() needs at least read permission.

The Linux only unit test can be bypassed on other systems with
testthat::skip_on_os().

Best regards,

ir. Thierry Onkelinx
Statisticus / Statistician

Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE
AND FOREST
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
thierry.onkelinx at inbo.be
Kliniekstraat 25, B-1070 Brussel
www.inbo.be

///////////////////////////////////////////////////////////////////////////////////////////
To call in the statistician after the experiment is done may be no
more than asking him to perform a post-mortem examination: he may be
able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does
not ensure that a reasonable answer can be extracted from a given body
of data. ~ John Tukey
///////////////////////////////////////////////////////////////////////////////////////////


Van 14 tot en met 19 december 2017 verhuizen we uit onze vestiging in
Brussel naar het Herman Teirlinckgebouw op de site Thurn & Taxis.
Vanaf dan ben je welkom op het nieuwe adres: Havenlaan 88 bus 73, 1000 Brussel.

///////////////////////////////////////////////////////////////////////////////////////////



2017-12-12 18:42 GMT+01:00 Tom Wainwright <tcwainw at gmail.com>: