## File(filename, mode)

#### new File(filename, mode)
`doc/classes.js`, `line 10`

  Open a file, for file modes see FILE. Files can only either be read or written, never both.Writing to a closed file throws an exception.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `filename` | string | the name of the file.
  `mode` | string | READ, WRITE or APPEND.

### Methods

#### Close()
`doc/classes.js`, `line 38`

  Close the file.

#### ReadByte() → {number}
`doc/classes.js`, `line 15`

  Read a single byte from file and return it as number.

  ##### Returns:

  number - the byte as a number or null for EOF.

#### ReadLine() → {string}
`doc/classes.js`, `line 24`

  Read a line of text from file. The maximum line length is 4096 byte.

  ##### Returns:

  string - the next line or null for EOF.

#### WriteByte()
`doc/classes.js`, `line 19`

  Write a single byte to a file.

#### WriteLine(txt)
`doc/classes.js`, `line 29`

  Write a NEWLINE terminated string to a file.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `txt` | string | the string to write.

#### WriteString(txt)
`doc/classes.js`, `line 34`

  Write a string to a file.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `txt` | string | the string to write.