> For the complete documentation index, see [llms.txt](https://jmdash.gitbook.io/jmdash-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jmdash.gitbook.io/jmdash-docs/jmbasics/syntax101/calling-functions/other-libraries/file-read-and-write.md).

# File: Read and Write

The **File: Read and Write** library is *basically* **JM-**'s own version of **C++**'s `<fstream>`,\
and can be included in a **JM-** Project using: `#incd .frnw`

If something isn't clear about the syntax shown below, we recommend you to check out the [examples category](/jmdash-docs/examples/code-examples.md)

## Syntax & Examples

Here's a list of every function included in the `.frnw` library;

{% code lineNumbers="true" %}

```c
// fs.new{} Stands for 'FileSystem.New'
// Used to create files
// Syntax (spaced): fs.new{ >> "<path>" << "<fileName>.<fileExtension>" };
#incd .frnw
fs.new{>> "~/" << "README.md"};
```

{% endcode %}

{% code lineNumbers="true" %}

```c
// fs.rnw{} Stands for 'FileSystem.ReadAndWrite'
// Used to read, write and create files
// Syntax (spaced): fs.rnw{"<sourcePath>" << "<destinationPath>"};
#incd .frnw
fs.rnw{"~/README.md" << "/tmp/README.md"};
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jmdash.gitbook.io/jmdash-docs/jmbasics/syntax101/calling-functions/other-libraries/file-read-and-write.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
