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, ...)

    addFileSuffix(filePath, suffix, ...)

### 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.
`suffix` | `Character` scalar. File suffix.

### 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.
`addFileSuffix` | (For package developer) Check if file suffix existed and add suffix

### 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.4.0 Index]