Skip to content

tomxmm0/PlutoniumFilesystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PlutoniumFilesystem

This plugin adds additional functionality to ChaiScript that allows you to read and write files into your computer.

Installation

Usage

/*
  Creates a file handler.

   First param: File path
   Second param: Mode 
*/
var file = Filesystem("helloworld.txt", "w+");


/*
   Writes/appends into file.

   First param: string to write
*/
file.Write("Hello, World!")


/*
   Reads the contents of the file.
*/
var contents = file.Read();

print(contents) // Hello, World!

Notes

  • All available file modes are shown here.
    • The plugin will only create a file handle if the file already exists. therefore modes like r+ and w+ will act the same.
  • For security measures, the file must be within the game folder (Not exactly in it, could also be in a folder that's within the game folder).
  • For people who wish to build from source, make sure to set the C++ version to latest, set the run time library to /MT and only compile as Release and x86.
  • While the plugin automatically closes the file handle as it goes out of scope, to manually close it use the .Close() method.