tensorflow::WritableFile

This is an abstract class.

#include <file_system.h>

A file abstraction for sequential writing.

Summary

The implementation must provide buffering since callers may append small fragments at a time to the file.

Constructors and Destructors

WritableFile()
~WritableFile()

Public functions

Append(const StringPiece & data)=0
virtual Status
Append 'data' to the file.
Close()=0
virtual Status
Close the file.
Flush()=0
virtual Status
Flushes the file and optionally syncs contents to filesystem.
Sync()=0
virtual Status
Syncs contents of file to filesystem.

Public functions

Append

virtual Status Append(
  const StringPiece & data
)=0

Append 'data' to the file.

Close

virtual Status Close()=0

Close the file.

Flush() and de-allocate resources associated with this file

Typical return codes (not guaranteed to be exhaustive):

  • OK
  • Other codes, as returned from Flush()

Flush

virtual Status Flush()=0

Flushes the file and optionally syncs contents to filesystem.

This should flush any local buffers whose contents have not been delivered to the filesystem.

If the process terminates after a successful flush, the contents may still be persisted, since the underlying filesystem may eventually flush the contents. If the OS or machine crashes after a successful flush, the contents may or may not be persisted, depending on the implementation.

Sync

virtual Status Sync()=0

Syncs contents of file to filesystem.

This waits for confirmation from the filesystem that the contents of the file have been persisted to the filesystem; if the OS or machine crashes after a successful Sync, the contents should be properly saved.

WritableFile

 WritableFile()

~WritableFile

virtual  ~WritableFile()