NovaOS
GithubHomeLaunchNeed help?
  • Welcome to NovaOS👋
  • Get started
    • Access NovaOS
  • How to
    • NovaOS How To
      • Setting a custom wallpaper
      • Changing default openers
      • Using default apps
        • Nova Files App
      • Data recovery
      • Using the Tasks Dock
    • Publish to Nova Store
    • Protips
    • Feedback and suggest
    • Support NovaOS
  • docs
    • Basics
      • Introduction
      • Timing
      • File system
        • Overview on files
        • File management
      • User choices
        • Settings Keys
        • Choose files
      • Managing self
        • The Open Launch Protocol
        • The EventBusWorker
    • Standards
      • Styling standards
      • Error standards
    • Networking
      • Rotur In NovaOS
    • Features
  • References
    • The NovaOS Check list
    • Methods
      • Database management
      • File management
    • NTX Actions
    • Projects
  • Epic
    • Achievements
Powered by GitBook
On this page
  • Creating a file
  • Using createFile
  • File Metadata

Was this helpful?

  1. docs
  2. Basics
  3. File system

Overview on files

Nova has a GUI for managing files, which is the text app and files app, but what if you want to make one such? what if you need to make a file explorer or a text editor, what about a media player?

You will see just that in this documentation!

Creating a file

How do you make a file out of thin air in nova? well, you can make a file using the Nova.js createFile() function, nothing big nor complicated.

Using createFile

Take this, you are making a very basic text editor app, you need to save the stuff the user have been typing, here's how to use the createFile function for that.

await novaos.createFile(folderName, fileName, type, content, metadata)

Where folderName is the folder that the file should be saved at (the folder would be created if it doesn't exist.). fileName is the name of the file without file type extension. type is the type of the file, possible types are:

  • app : apps will be executed in a new window once opened.

  • image/png, image/svg, image/jpeg, image/jpg or any other will open in media viewer.

  • video/mp4, video/mpeg, video/mkv or any other will open in media viewer.

  • other supported formats (html, wav, mp3 etc.)

  • 8-bit arrays will be opened by default in text app as plain text.

File Metadata

Metadata is not a requirement for creating a file. Imagine you are taking a picture with the camera app, the next week you need that picture to see it again, you know when it was taken - how do you locate it? This is why metadata is a huge deal, saving more data like the date, time, location or other statuses can increase the chances of a file becoming more useful. Metadata in nova file ecosystem allows you to do just that, storing more data about the file content without changing the content.

By default, Nova OS saves the timestamp metadata. This is its format:

{"via":"nope","datetime":1731327471707}

âš  This saves the current date and time in the system's local time zone. datetime is the same as Date.now() method in JavaScript.

PreviousFile systemNextFile management

Last updated 6 months ago

Was this helpful?