linuxspaces: Handle spaces in Linux filenames

View source: R/linuxspaces.R

linuxspacesR Documentation

Handle spaces in Linux filenames

Description

Convert spaces in filenames (" ") to linux-type spaces "\ ", needed when calling system() on macOS.

Usage

linuxspaces(txt)

Arguments

txt

filename, which may contain ordinary spaces, e.g. "my file 1.txt"

Value

filename with modified spaces, e.g. "my\ file\ 1.txt"

Author(s)

Danail Obreschkow

Examples

filename = '~/Desktop/my file 1.txt'
command = sprintf('ls -l %s',linuxspaces(filename))
## Not run: 
system(command)

## End(Not run)


obreschkow/cooltools documentation built on Nov. 16, 2024, 2:46 a.m.