Management of ENVI files similar to functions of OS file manager.
envi_exists(pattern = ".+", path = ".", all.files = FALSE, full.names = TRUE,
recursive = FALSE, ignore.case = TRUE, exact = FALSE)
envi_list(pattern = ".+", path = ".", all.files = FALSE, full.names = recursive,
recursive = FALSE, ignore.case = TRUE, exact = FALSE)
envi_remove(pattern = ".+", path = ".", all.files = FALSE, full.names = recursive,
recursive = FALSE, ignore.case = TRUE, verbose = FALSE)
envi_copy(src, dst, overwrite = TRUE)
envi_rename(src, dst, overwrite = TRUE)ursa_exists(fname)
envi_exists()
returns integer number of found ENVI files.
envi_list()
returns character vector of found ENVI files.
envi_remove()
returns character vector of deleted ENVI files.
envi_copy()
returns 0L.
envi_rename()
returns value of file.rename
, which is applied to objects in file system.
ursa_exists()
returs TRUE
if any *.tif, *.tiff, *.bin, *.hfa file is found.
Either filename (like basename
function) or mask in format of regular expressions or full path name.
Either path name (like dirname
function) or ignored if pattern
describes full path.
A logical value. If FALSE, only the names of visible files are returned. If TRUE, all file names will be returned. Similar to all.files
argument in list.files
function
A logical value. If TRUE, the directory path is prepended to the file names to give a relative file path. If FALSE, the file names (rather than paths) are returned. Similar to full.names
argument in list.files
function
Logical. Should the listing recurse into directories? Similar to recursive
argument in list.files
function
Logical. Should pattern-matching be case-insensitive? Similar to ignore.case
argument in list.files
function
Logical. Attempt to cancel regular expressions.
Logical. TRUE
provides some additional information on console.
Strings of length 1 or more. Name or directory name or path of source ENVI files.
Strings of length 1 or more. Name or directory name path of destination ENVI files. Length is assuming to be equal to length of src
Logical. TRUE
overwrites destinations ENVI files. FALSE
does nothing if destinaton ENVI file exists.
Character. Full file name or file pattern with file path.
Nikita Platonov platonov@sevin.ru
Functions do not view content of any files. The major identifier of ENVI files in file system is ENVI header (*.hdr) file. Binary file is searching along 1) original *.envi, *.bin, *.img, *.dat extensions, 2) externally packing *.gz. *.bz2, *.xz extensions, or 3) packed by this package *.envigz, *.bingz extensions. Functions envi_copy()
and envi_rename()
keeps original extension of ENVI binary file; use file.rename
to rename ENVI binary file.
session_grid(NULL)
wd <- setwd(tempdir())
a1 <- create_envi("tmp1.envi")
a2 <- create_envi("tmp2.")
close(a1,a2)
envi_list()
envi_copy("tmp1","tmp3")
envi_copy("tmp2","tmp4")
envi_list()
envi_rename("tmp3","tmp5")
envi_list()
envi_exists("nofilewithsuchname")
envi_exists("tmp[34]")
envi_remove(".+")
envi_list()
setwd(wd)
Run the code above in your browser using DataLab