BS Files

Learn how BornomalaScript can read and write files.

Files

Files let your program save and load information from disk.

That means your code can work with data even after the program closes.

Why Files Matter

File handling is useful for:

  • saving notes
  • reading configuration
  • storing data between runs
  • exporting results

Conceptual Overview

File operations usually follow this pattern:

  1. Open the file
  2. Read or write the content
  3. Close the file

That pattern keeps file access organized and safe.

When to Use File Operations

Use files when your program needs to:

  • remember data
  • share output with another program
  • load existing information

Common Mistakes

Beginners often make these mistakes:

  • forgetting to close the file
  • writing to the wrong path
  • trying to read a file that does not exist
  • mixing up text content and file names

Practice Task

Think about a simple app that could:

  1. save a name to a file
  2. read a saved name back
  3. write a short report to disk

Quick Checklist

Before moving on, make sure you can:

  • explain why files are useful
  • describe the basic open/read/write/close flow
  • identify situations where disk storage matters

If yes, you understand the basics of file handling.