vsi_is_local()
returns whether the file/filesystem is "local".
Wrapper for VSIIsLocal()
in the GDAL API. Requires GDAL >= 3.6.
Note
The concept of local is mostly by opposition with a network / remote file system whose access time can be long.
/vsimem/ is considered to be a local file system, although a non-persistent one.
Examples
# Requires GDAL >= 3.6
if (as.integer(gdal_version()[2]) >= 3060000)
print(vsi_is_local("/vsimem/test-mem-file.tif"))
#> [1] TRUE