Directory management

Share:

Description

Functions for listing the contents of a directory, making new directories, or deleting entire directories in the iPlant infrastructure

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
ListDir(dir.name, dir.path="", print.curl=FALSE, shared.username=NULL,
        suppress.Warnings=FALSE, show.hidden=FALSE)
ShareDir(dir.name, dir.path="", shared.username, read=TRUE, execute=TRUE,
         write=TRUE, print.curl=FALSE, suppress.Warnings=FALSE) 
PermissionsDir(dir.name, dir.path="", print.curl=FALSE, suppress.Warnings=FALSE)
RenameDir(dir.name, new.dir.name, dir.path="", print.curl=FALSE, suppress.Warnings=FALSE)
CopyDir(dir.name, dir.path="", end.path="", print.curl=FALSE, suppress.Warnings=FALSE)
MoveDir(dir.name, dir.path="", end.path="", print.curl=FALSE, suppress.Warnings=FALSE)
MakeDir(dir.name, dir.path="", print.curl=FALSE, suppress.Warnings=FALSE)
DeleteDir(dir.name, dir.path="", print.curl=FALSE, suppress.Warnings=FALSE)

Arguments

dir.path

optional path to a user's sub directory on the iPlant servers; default path is empty, which leads to the home directory

dir.name

name of subdirectory to be modified on the iPlant server in the dir.path

new.dir.name

the new name of the directory on the iPlant server to be renamed

end.path

Path to destination sub directory where directory on the iPlant server is moved to; default path is empty which leads to a users home directory

print.curl

Prints the curl statement that can be used in the terminal, if curl is installed on your computer

shared.username

With iPlant you have the ability to share files with other users, their username is the value for the shared.username, see details.

suppress.Warnings

This will turn off the warnings, will speed up run time. Use with caution, if the inputs are incorrect they will not be caught.

read

Gives read permissions for shared directory

write

Gives write permissions for shared directory

execute

Gives execute permissions for shared directory

show.hidden

Option to display hidden files (ie, ".svn", ".Rdata")

Details

The ListDir function lists the files in the given directory, dir.path. If listing shared folders then the dir.path becomes the path to the SHARED users shared folder. iPlant offers sharing of files between two (or more) iPlant users, the ShareDir makes it so. Once sharing is done a user can use PermissionsDir on any directory to find who the folder is shared with. The RenameDir function renames the dir.name in dir.path (on the iPlant servers), to the new.dir.name. The CopyDir function moves a dir.name in the dir.path to the end.path. The MoveDir function moves a dir.name in the dir.path to the end.path .The MakeDir function makes a directory dir.name in the directory dir.path. The DeleteDir function deletes the directory dir.name in the directory dir.path.

Value

If an error, then a message stating the error should also be reported.

See Also

UploadFile

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Makes the subdirectory named "new" in the users 'rPlant' directory
## Not run: MakeDir(dir.name="new", dir.path="data")

# Shares the subdirectory named "new" with the iPlant user "dude"
## Not run: ShareDir(dir.name="new", dir.path="data", shared.username="dude")

# Checks permissions folder "new"
## Not run: PermissionsDir(dir.name="new", dir.path="data")

# Lists the contents of a user's subdirectory "new"
## Not run: ListDir(dir.name="new". dir.path="data")

# Rename the directory
## Not run: RenameDir(dir.name="new", dir.path="data", new.dir.name="newest")
 
 # Copy a subdirectory `newest' from the directory `data' to the home directory
## Not run: CopyDir(dir.name="newest", dir.path="data", end.path="")
            
# Move a subdirectory `newest' from the directory `data' to the home directory
## Not run: MoveDir(dir.name="newest", dir.path="data", end.path="")

# Deletes the subdirectory "newest"
## Not run: DeleteDir(dir.name="newest", dir.path="")