% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/buffer.R
\name{buffer_open}
\alias{buffer_open}
\title{Open an Existing Buffer}
\usage{
buffer_open(path, type, dim, backing = c("mmap", "shm"), readonly = FALSE)
}
\arguments{
\item{path}{Path or shm name of the buffer's segment.}

\item{type}{Character. Data type of the buffer.}

\item{dim}{Integer vector. Dimensions of the buffer.}

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

\item{readonly}{Logical. Open as read-only? Default FALSE for workers.}
}
\value{
A \code{shard_buffer} object attached to the existing segment.
}
\description{
Opens a shared memory buffer that was created in another process.
Used by workers to attach to the parent's output buffer.
}
\examples{
\donttest{
buf <- buffer("double", dim = 10)
path <- buffer_path(buf)
buf2 <- buffer_open(path, type = "double", dim = 10, backing = "mmap")
buffer_close(buf2, unlink = FALSE)
buffer_close(buf)
}
}
