File: dts.Rd

package info (click to toggle)
r-cran-kutils 1.73%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,648 kB
  • sloc: sh: 13; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 821 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{dts}
\alias{dts}
\title{Delete trailing slash}
\usage{
dts(name)
}
\arguments{
\item{name}{A path}
}
\value{
Same path with trailing "/" removed.
}
\description{
This function cleans up a path string by removing the trailing
slash.  This is necessary on MS Windows, \code{file.exists(fn)} fails
if "/" is on end of file name. Deleting the trailing slash is thus
required on Windows and it is not harmful on other platforms.
}
\details{
All usages of \code{file.exists(fn)} in R should be revised
to be multi-platform safe by writing \code{file.exists(dts(fn))}.

This version also removes repeated adjacent slashes, so that
\code{"/tmp///paul//test/"} becomes \code{"/tmp/paul/test"}.
}
\author{
Paul Johnson <pauljohn@ku.edu>
}