Christopher Hammill
2019-Apr-15 17:44 UTC
[Rd] Feature request: make file.exists interruptable
Hi R developers, On slow file systems with large lists of files, file.exists can take a long time to run. It would be nice if users could interrupt this function. I think it would be simple to add: https://svn.r-project.org/R/trunk/src/main/platform.c, at line 1373, add "R_CheckUserInterrupt();" perhaps every some number of iterations if performance is a concern here. Thanks, Chris ________________________________ This e-mail may contain confidential, personal and/or health information(information which may be subject to legal restrictions on use, retention and/or disclosure) for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies. [[alternative HTML version deleted]]
Prof Brian Ripley
2019-Apr-16 14:24 UTC
[Rd] Feature request: make file.exists interruptable
The place for feature requests is bugs.r-project.org . On 15/04/2019 18:44, Christopher Hammill wrote:> Hi R developers, > > On slow file systems with large lists of files, file.exists can take a long time to run. It would be nice if users could interrupt this function. I think it would be simple to add: > > https://svn.r-project.org/R/trunk/src/main/platform.c, > > at line 1373, add "R_CheckUserInterrupt();" perhaps every some number of iterations if performance is a concern here.It is a concern, and it is (very) unusual to call file.exists() on more than one file (as its name implies). Perhaps you could give us some idea of what you are trying to do and how many files take how many seconds on what OS/filesystem. For completeness, dir.exists() can be used with more than one path and potentially has the same issue. -- Brian D. Ripley, ripley at stats.ox.ac.uk Emeritus Professor of Applied Statistics, University of Oxford
Christopher Hammill
2019-Apr-16 14:45 UTC
[Rd] Feature request: make file.exists interruptable
Thanks Dr. Ripley, Unfortunately it is no longer possible for new users to file bugs on the the R bugzilla. The current guidelines on https://www.r-project.org/bugs.html say to post here: NOTE: due to abuse by spammers, since 2016-07-09 only ?members? (including all who have previously submitted bugs) can submit new bugs on R?s Bugzilla. For now, either post (e-mail) your bug report to R-devel or ask an R Core member to add you manually to R?s Bugzilla members. Would you be able to add me to the bugzilla so that I can raise this there? Thanks, Chris ________________________________ From: Prof Brian Ripley <ripley at stats.ox.ac.uk> Sent: April 16, 2019 10:24 AM To: Christopher Hammill; r-devel at r-project.org Subject: Re: [Rd] Feature request: make file.exists interruptable The place for feature requests is bugs.r-project.org . On 15/04/2019 18:44, Christopher Hammill wrote:> Hi R developers, > > On slow file systems with large lists of files, file.exists can take a long time to run. It would be nice if users could interrupt this function. I think it would be simple to add: > > https://urldefense.proofpoint.com/v2/url?u=https-3A__svn.r-2Dproject.org_R_trunk_src_main_platform.c&d=DwICaQ&c=Sj806OTFwmuG2UO1EEDr-2uZRzm2EPz39TfVBG2Km-o&r=lNvpYHQ4ryl-NV5xIfGm88weE3pfbkzPUhFP6JD9S0k&m=Cnn1q_4cCTrMD3ai1HxEiW5hlvocyLp-aeYwakHTkEg&s=txQR4ftIfgjYw9N4viGK_6JZv3sMwOk4VBRXQBVqTeI&e=, > > at line 1373, add "R_CheckUserInterrupt();" perhaps every some number of iterations if performance is a concern here.It is a concern, and it is (very) unusual to call file.exists() on more than one file (as its name implies). Perhaps you could give us some idea of what you are trying to do and how many files take how many seconds on what OS/filesystem. For completeness, dir.exists() can be used with more than one path and potentially has the same issue. -- Brian D. Ripley, ripley at stats.ox.ac.uk Emeritus Professor of Applied Statistics, University of Oxford ________________________________ This e-mail may contain confidential, personal and/or health information(information which may be subject to legal restrictions on use, retention and/or disclosure) for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies. [[alternative HTML version deleted]]