Usage of each block

日本語のページ

Open file

Open file

This function opens the specified file in the specified mode.
If the mode is set to "write," any existing file contents will be erased.
If the "update" checkbox is enabled, the existing file can be updated.
If the "binary" checkbox is enabled, the file can be treated as binary.

The function returns the ID of the file object.
This ID should be assigned to a variable and used when manipulating the file.

Open file and set to variable

Close file

Close file

Closes an open file.

Write text to file

Write text data to file

Writes text to the file specified by the file ID.
If you check the "newline" option, a line break character will be added after you type the text.

Read all text from file

Read all text data from file

Reads all content from the file specified by the file ID as text.

Read a line of text from file

Read one line from file

Reads one line from the file specified by the file ID as text.
If there is a newline character at the end of the line, the return value will be the string with that newline character included.

Read specified number of characters from File

Read characters from file

Reads the specified number of characters from the file specified by the file ID as text.

Write binary data to file

Write binary data to file

Writes binary data to the file specified by the file ID.
The data will be passed as a list of numbers.

Read binary data from File

Read binary data from file

Reads the specified number of bytes from the file specified by the file ID as binary data.
The return value will be a list of numbers.

Get current position

Get file pointer

Gets the current file pointer position.

Set current position

Set file pointer

Sets the file pointer position to the specified value.
In text files, you can only specify the position from the beginning of the file.