Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » system facilities » using sockets » isInputFile(File)
next | previous | forward | backward | up | index | toc

# isInputFile(File) -- whether a file is open for input

- Function: isInputFile
- Usage:
    `isInputFile f`
- Inputs:
  - f, a file
- Outputs:
  - a Boolean value, whether f is an open input file

## Description

    i1 : "test-file" << "hi there" << close

    o1 = test-file

    o1 : File

    i2 : isInputFile oo

    o2 = false

    i3 : f = openIn "test-file"

    o3 = test-file

    o3 : File

    i4 : isInputFile f

    o4 = true

    i5 : isOpen f

    o5 = true

    i6 : get f

    o6 = hi there

    i7 : isInputFile f

    o7 = false

    i8 : isOpen f

    o8 = false

    i9 : removeFile "test-file"

## See also

- openIn -- open an input file
- openInOut -- open an input output file
- get -- get the contents of a file
- isOpen -- whether a file or database is open
- close -- close a file

## Ways to use this method:

- isInputFile(File) -- whether a file is open for input

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/ov_system.m2:570:0.