% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/segment.R
\name{segment_open}
\alias{segment_open}
\title{Open an existing shared memory segment}
\usage{
segment_open(path, backing = c("mmap", "shm"), readonly = TRUE)
}
\arguments{
\item{path}{Path or shm name of the segment}

\item{backing}{Backing type: "mmap" or "shm"}

\item{readonly}{Open as read-only}
}
\value{
A \code{shard_segment} object attached to the existing segment.
}
\description{
Open an existing shared memory segment
}
\examples{
\donttest{
seg <- segment_create(1024, backing = "mmap")
path <- segment_path(seg)
seg2 <- segment_open(path, backing = "mmap", readonly = TRUE)
segment_close(seg2, unlink = FALSE)
segment_close(seg)
}
}
