Get the process ID of the R Session. It is guaranteed by the operating system that two R sessions running simultaneously will have different IDs, but it is possible that R sessions running at different times will have the same ID.
Sys.getpid()
# NOT RUN {
Sys.getpid()
## Show files opened from this R process
if(.Platform$OS.type == "unix") ## on Unix-alikes such Linux, macOS, FreeBSD:
system(paste("lsof -p", Sys.getpid()))
# }