Object/Class

org.platanios.tensorflow.api.io

FileIO

Related Docs: class FileIO | package io

Permalink

object FileIO extends Serializable

Contains helper functions for dealing with file IO.

Linear Supertypes
Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FileIO
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type FileStatistics = jni.FileStatistics

    Permalink
  2. sealed trait Mode extends AnyRef

    Permalink

    Mode in which to open a file.

  3. sealed trait Whence extends AnyRef

    Permalink

    Used to represent the position reference for calls to seek.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. object APPEND extends Mode with Product with Serializable

    Permalink

    Open file for appending.

    Open file for appending. The file pointer will be at the end of the file if the file exists. That is, the file is in the append mode. If the file does not exist, a new file is created for writing.

  5. object CURRENT_POSITION extends Whence with Product with Serializable

    Permalink
  6. object END_OF_FILE extends Whence with Product with Serializable

    Permalink
  7. val FileStatistics: jni.FileStatistics.type

    Permalink
  8. object READ extends Mode with Product with Serializable

    Permalink

    Open file for reading.

    Open file for reading. The file pointer will be at the beginning of the file.

  9. object READ_APPEND extends Mode with Product with Serializable

    Permalink

    Open file for both reading and appending.

    Open file for both reading and appending. The file pointer will be at the end of the file if the file exists. That is, the file is in the append mode. If the file does not exist, a new file is created for writing.

  10. object READ_WRITE extends Mode with Product with Serializable

    Permalink

    Open file for both reading and writing.

    Open file for both reading and writing. The file pointer will be at the beginning of the file.

  11. object READ_WRITE_TRUNCATE extends Mode with Product with Serializable

    Permalink

    Open file for both reading and writing.

    Open file for both reading and writing. Overwrite the file if the file exists. If the file does not exist, creates a new file for writing.

  12. object START_OF_FILE extends Whence with Product with Serializable

    Permalink
  13. object WRITE extends Mode with Product with Serializable

    Permalink

    Open file for writing only.

    Open file for writing only. Overwrite the file if the file exists. If the file does not exist, creates a new file for writing.

  14. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  15. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  16. def copyFile(oldPath: Path, newPath: Path, overwrite: Boolean = false): Unit

    Permalink

    Copies data from the file at oldPath to a new file at newPath.

    Copies data from the file at oldPath to a new file at newPath.

    oldPath

    Old file path.

    newPath

    New file path.

    overwrite

    Boolean value indicating whether it is allowed to overwrite the file at newPath, if one already exists.

  17. def deleteFile(filePath: Path): Unit

    Permalink

    Deletes the file located at filePath.

    Deletes the file located at filePath.

    filePath

    File path.

  18. def deleteMatchingPaths(path: Path): Unit

    Permalink

    Deletes all the matching paths to the path pattern provided.

    Deletes all the matching paths to the path pattern provided.

    The pattern must follow the TensorFlow path pattern rules and it pattern must match all of a name (i.e., not just a substring). A pattern definition has the following form:

    pattern: { term }
    term:
      '*': matches any sequence of non-'/' characters
      '?': matches a single non-'/' character
      '[' [ '^' ] { match-list } ']': matches any single character (not) on the list
      c: matches character c (c != '*', '?', '\\', '[')
      '\\' c: matches character c
    character-range:
      c: matches character c (c != '\\', '-', ']')
      '\\' c: matches character c
      lo '-' hi: matches character c for lo <= c <= hi
    path

    Path pattern.

  19. def deleteRecursively(path: Path): Unit

    Permalink

    Deletes everything under the provided path, recursively.

    Deletes everything under the provided path, recursively.

    path

    Path to a file or directory.

  20. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  21. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  22. def exists(filePath: Path): Boolean

    Permalink

    Determines whether a path exists or not.

    Determines whether a path exists or not.

    filePath

    Path to a file or directory.

    returns

    true if the path exists, whether its a file or a directory, and false if the path does not exist and there are no filesystem errors.

  23. def fileStatistics(path: Path): FileStatistics

    Permalink

    Returns file statistics for the provided path.

    Returns file statistics for the provided path.

    path

    Path to a file or directory.

    returns

    File statistics for the file/directory pointed to by path.

  24. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  25. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  26. def getLastModifiedTime(path: Path, unit: TimeUnit = TimeUnit.SECONDS, followSymbolicLinks: Boolean = true): Long

    Permalink

    Returns a file's last modified time.

    Returns a file's last modified time.

    path

    Path to the file.

    unit

    Time unit in which to return the last modified time. Defaults to TimeUnit.SECONDS.

    followSymbolicLinks

    Boolean value indicating whether or not to follow symbolic links. By default, symbolic links are followed and the file attribute of the final target of the link is read. If followSymbolicLinks is set to false, then symbolic links are not followed.

  27. def getMatchingPaths(path: Path, useNativeFileIO: Boolean = true): Set[Path]

    Permalink

    Gets all the matching paths to the path pattern provided.

    Gets all the matching paths to the path pattern provided.

    The pattern must follow the TensorFlow path pattern rules and it pattern must match all of a name (i.e., not just a substring). A pattern definition has the following form:

    pattern: { term }
    term:
      '*': matches any sequence of non-'/' characters
      '?': matches a single non-'/' character
      '[' [ '^' ] { match-list } ']': matches any single character (not) on the list
      c: matches character c (c != '*', '?', '\\', '[')
      '\\' c: matches character c
    character-range:
      c: matches character c (c != '\\', '-', ']')
      '\\' c: matches character c
      lo '-' hi: matches character c for lo <= c <= hi
    path

    Path pattern.

    returns

    Set of all paths matching the provided path pattern.

  28. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  29. def isDirectory(path: Path): Boolean

    Permalink

    Returns true is path points to a directory, and false otherwise.

    Returns true is path points to a directory, and false otherwise.

    path

    Path to a file or directory.

    returns

    true is path points to a directory, and false otherwise.

  30. def isGCSPath(path: Path): Boolean

    Permalink

    Returns true if path points to a Google Cloud Service (GCS) path.

  31. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  32. def listDirectories(dirPath: Path): Seq[Path]

    Permalink

    Returns all entries contained within the directory at path.

    Returns all entries contained within the directory at path. The returned sequence is in arbitrary order and it does not contain the special entries "." and "..".

    dirPath

    Path to a directory.

    returns

    Sequence of entries contained in the directory at path.

    Annotations
    @throws( ... )
    Exceptions thrown

    NotFoundException If the provided directory does not exist.

  33. def mkDir(path: Path): Unit

    Permalink

    Creates a directory at path, but requires that all the parent directories exist.

    Creates a directory at path, but requires that all the parent directories exist. If they may not exist, mkDirs() should be used instead. The call is also successful if a directory already exists at path.

    path

    Directory path.

  34. def mkDirs(path: Path): Unit

    Permalink

    Creates a directory at path, along with all necessary parent/intermediate directories.

    Creates a directory at path, along with all necessary parent/intermediate directories. The call is also successful if a directory already exists at path.

    path

    Directory path.

  35. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  36. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  37. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  38. def readFileToString(filePath: Path): String

    Permalink

    Reads the entire contents of the file located at filePath to a string and returns it.

  39. def rename(oldPath: Path, newPath: Path, overwrite: Boolean = false): Unit

    Permalink

    Rename/move data from the file/directory at oldPath to a new file/directory at newPath.

    Rename/move data from the file/directory at oldPath to a new file/directory at newPath.

    oldPath

    Old path.

    newPath

    New path.

    overwrite

    Boolean value indicating whether it is allowed to overwrite the file/directory at newPath, if one already exists.

  40. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  41. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  42. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. def walk(dirPath: Path, inOrder: Boolean = true): Stream[(Path, Seq[Path], Seq[Path])]

    Permalink

    Walks a directory tree rooted at dirPath recursively.

    Walks a directory tree rooted at dirPath recursively.

    Note that exceptions that are thrown while listing directories are ignored.

    dirPath

    Path to a directory from which to start traversing.

    inOrder

    If true, the top-level directories are returned first, otherwise they are returned last.

    returns

    Stream over tuples containing: (i) the path for the directory, (ii) a sequence containing all of its subdirectories, and (iii) a sequence containing all files in that directory.

  46. def writeStringToFile(filePath: Path, content: String): Unit

    Permalink

    Writes the provided string to the file located at filePath.

  47. def writeStringToFileAtomic(filePath: Path, content: String, overwrite: Boolean = true): Unit

    Permalink

    Writes the provided string to the file located at filePath as an atomic operation.

    Writes the provided string to the file located at filePath as an atomic operation. This means that when filePath appears in the filesystem, it will contain all of content. With writeStringToFile(), it is possible for the file to appear in the filesystem with content only partially written.

    The atomic write is achieved by first writing to a temporary file and then renaming that file.

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped