[Rd] LOGNAME env var in the check code

Kurt Hornik Kurt@Horn|k @end|ng |rom wu@@c@@t
Thu Nov 18 21:25:34 CET 2021


>>>>> Gábor Csárdi writes:

Thanks.  c81206 changes to use 

  user <- Sys.info()[["effective_user"]]

which afawct should always give the same  as the uname for files created
by the current user.  Pls check: if not, we can go for something like

foo <- function() {
    writeLines("ABC", tf <- tempfile())
    on.exit(unlink(tf))
    file.info(tf)$uname
}

Best
-k


> While trying to reproduce a NOTE for
> * checking for new files in some other directories ... NOTE

> I noticed that the check code uses

> Sys.getenv("LOGNAME")

> to query the name of the current user. However on many systems this is
> not set, so this is the empty string, and then no NOTE is shown. (Only
> files owned by the current user generate a NOTE.)

> An alternative would be to call `id -un` to query the username, or
> create a file and then use `file.info()` to query its owner. Using one
> of these alternatives would make this check more reproducible.

> Thanks,
> Gabor

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



More information about the R-devel mailing list