I'm experiencing a weird issue, and wondering if anyone has seen this, and better yet has a solution.

At work we are getting lots of issues with 'permission denied' or 'network not found' and so forth when reading and writing between our machines and a file server. This happens randomly so the following function solves the problem for 'cat' commands:

catSafer <-
function (..., ReTries = 20, ThrowError = TRUE)
{
    for (catsi in seq_len(ReTries)) {
        res <- try(cat(...))
        if (!inherits(res, "try-error"))
            break
    }
    if (inherits(res, "try-error")) {
        if (ThrowError) {
            stop("file connection failed")
        }
        else {
            warning("file connection failed")
        }
    }
}

People have done network traces and such, but so far nothing has been seen.

Thanks,
Pat

--
Patrick Burns
pbu...@pburns.seanet.com
http://www.portfolioprobe.com/blog
http://www.burns-stat.com
(home of:
 'Impatient R'
 'The R Inferno'
 'Tao Te Programming')

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to