sFilename = $sFilename; } /** * Uses fopen() to open a filehandle. Stores * opened filehandle in $this->fd * * @param string mode, as accepted by fopen() * @return boolean return value from fopen() */ function open($sMode) { $bSucceeded = FALSE; $handle = fopen($this->sFilename, $sMode); if ($handle) { $this->fd = $handle; $bSucceeded = TRUE; } $this->bTriedOpen = TRUE; return $bSucceeded; } /** * Closes filehandle and calls resetFile() * * @return boolean status from fclose() */ function close() { $bStatus = fclose($this->fd); $this->resetFile(); return $bStatus; } /** * Sets $this->fd to NULL and resets * $this->bTriedOpen flag to FALSE. * * @return boolean status from fclose() */ function resetFile() { $this->fd = NULL; $this->bTriedOpen = FALSE; } } ?>