[R] [FORGED] file.exists() on device files

Jeff Newmiller jdnewmil at dcn.davis.ca.us
Fri Jan 13 17:43:14 CET 2017


Of course they have separate criteria for determining existence... they do different things, and therefore have different requirements for access permissions.
-- 
Sent from my phone. Please excuse my brevity.

On January 13, 2017 3:54:35 AM PST, Benjamin Tyner <btyner at gmail.com> wrote:
>Thank you for the insights, Rolf and Henrik.
>
>To give another example, this time in non-interactive mode,
>
>    Rscript -e "file.exists(commandArgs(TRUE))" <(echo "Hi")
>
>    [1] TRUE
>
>versus
>
>    Rscript -e "normalizePath(commandArgs(TRUE))" <(echo "Hi")
>    [1] "/dev/fd/63"
>    Warning message:
>    In normalizePath(commandArgs(TRUE)) :
>      path[1]="/dev/fd/63": No such file or directory
>
>It almost seems like file.exists and normalizePath use separate
>criteria 
>for determining existence?
>
>Regards
>
>Ben
>
>On 01/12/2017 01:42 AM, Rolf Turner wrote:
>> On 12/01/17 16:33, Henrik Bengtsson wrote:
>>
>> <SNIP>
>>
>>> FYI, the /proc is there because Unix has something called the "proc
>>> filesystem (procfs; https://en.wikipedia.org/wiki/Procfs) is a
>special
>>> filesystem in Unix-like operating systems that presents information
>>> about processes and other system information in a hierarchical
>>> file-like structure".  For instance, you can query the uptime of the
>>> machine by reading from /proc/uptime:
>>>
>>> $ cat /proc/uptime
>>> 332826.96 661438.10
>>>
>>> $ cat /proc/uptime
>>> 332871.40 661568.50
>>>
>>>
>>> You can get all IDs (PIDs) of all processes currently running:
>>>
>>> $ ls /proc/ | grep -E '^[0-9]+$'
>>>
>>> and for each process you there are multiple attributes mapped as
>>> files, e.g. if I start R as:
>>>
>>> $ R --args -e "message('hello there')"
>>>
>>> then I can query that process as:
>>>
>>> $ pid=$(pidof R)
>>> $ echo $pid
>>> 26323
>>>
>>> $ cat /proc/26323/cmdline
>>> /usr/lib/R/bin/exec/R--args-emessage('hello there')
>>>
>>> Unix is neat
>>
>> Indeed.  Couldn't agree more.  Thanks for the insight.
>>
>> <SNIP>
>>
>> cheers,
>>
>> Rolf
>>
>
>______________________________________________
>R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list