rename_file: rename_file: Rename a File/Directory on a FileSystem

Description Usage Arguments Value See Also Examples

View source: R/rename_file.R

Description

Rename a File/Directory on a FileSystem

Usage

1
2
3
4
5
6
7
8
rename_file(fs, fromPath, toPath, ...)

## Default S3 method:
rename_file(fs, fromPath, toPath, ...)

## S3 method for class 'webhdfs'
rename_file(fs, fromPath, toPath, overwrite = FALSE,
  ...)

Arguments

fs

FileSystem object

fromPath

a character vector that contains the path renaming from

toPath

a character vector that contains the path renaming to. If it starts with / the absolute path is taken, otherwise toPath is relative to webhdfs home derived by get_webhdfs_home

...

other arguments

overwrite

a file if TRUE and file already exists

Value

TRUE if successful, FALSE otherwise

See Also

get_webhdfs_home

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
## move file /user/<username>/foo (in hdfs) to
## /user/<username>/bar/foo
rename_file(hdfs, "foo", "bar/foo")

## move file /user/<username>/foo (in hdfs) to
## /mypath/foo
rename_file(hdfs, "foo", "/mypath/foo")

## End(Not run)

saurfang/rwebhdfs documentation built on May 29, 2019, 3:20 p.m.