Utils {pipeFrame} | R Documentation

## Functions for directory operations

### Description

Functions for directory operations

### Usage

    getBasenamePrefix(filepath, words, ...)

    getPathPrefix(filepath, words, ...)

    checkFileExist(filePath, ...)

    checkPathExist(filePath, ...)

    checkFileCreatable(filePath, ...)

### Arguments

`filepath` | `character` scalar or vector.
`words` | `character` scalar. Remove substring of the path characters starting to match the word
`...` | Additional arguments, currently unused
`filePath` | `Character` scalar.

### Value

`getBasenamePrefix` | Get the filepath basename with removed suffix
`getPathPrefix` | Get the filepath with removed suffix
`checkFileExist` | (For package developer) Check file is exist.
`checkPathExist` | (For package developer) Check directory is exist.
`checkFileCreatable` | (For package developer) Check file creatable.

### Examples

    getBasenamePrefix("aaa/bbb.ccc.ddd","cCc")

    getBasenamePrefix("aaa/bbb.ccc.ddd","ddd")

    getPathPrefix("aaa/bbb.ccc.ddd","dDd")

    getPathPrefix("aaa/bbb.ccc.ddd","ccc")

    file.create("test.bed")

    checkFileExist("test.bed")

    tryCatch({checkFileExist("test.bed1")},error = function(e) e)

    dir.create("testdir")

    checkPathExist(file.path(getwd(),"testdir"))

    tryCatch({checkPathExist(file.path(dirname(getwd()),
    "notexistfolder","testdir"))},error = function(e) e)

    checkFileCreatable("aaa.bed")

    tryCatch({checkFileCreatable("testdir1/aaa.bed")},error = function(e) e)

[Package pipeFrame version 1.2.2 Index]