% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/S3_core.R
\name{close.HDF5Matrix}
\alias{close.HDF5Matrix}
\title{Close HDF5Matrix}
\usage{
\method{close}{HDF5Matrix}(con, ...)
}
\arguments{
\item{con}{An \code{HDF5Matrix} object}

\item{...}{Additional arguments (currently ignored)}
}
\value{
Invisible \code{NULL}
}
\description{
Close an HDF5Matrix object and release file resources immediately.
This is the standard R interface for resource cleanup.
}
\details{
Closes the HDF5 dataset without waiting for garbage collection.
After calling \code{close()}, \code{is_valid()} returns \code{FALSE} and
any further operations on the object will fail. The file is immediately
accessible by other tools such as HDFView.

\strong{Both syntaxes work:}
\itemize{
\item \code{close(X)} - Standard R generic (recommended)
\item \code{X$close()} - R6 method (still supported)
}

For emergency closure of all open HDF5 objects in the session, see
\code{\link{hdf5_close_all}}.
}
\examples{
\donttest{
tmp <- tempfile(fileext = ".h5")

X  <- hdf5_create_matrix(tmp, "data/matrix", data = matrix(rnorm(100), 10, 10))

# Open matrix
X <- hdf5_matrix(tmp, "data/matrix")
data <- X[1:5, 1:5]

# Close using S3 method (recommended)
close(X)

# Or using R6 method (still works)
# X$close()

X$is_valid()  # FALSE

unlink(tmp)
}

}
\seealso{
\code{\link{hdf5_matrix}} for opening datasets,
\code{\link{hdf5_close_all}} for closing all open objects
}
