vx.FileMode

From vx
Jump to: navigation, search

[edit] vx.FileMode

This table contains all the modes possible when opening a vx.File object.

[edit] Available File Modes

  • vx.FileMode.Read - Open the file for reading/loading data. Will fail if the file doesn't exist or there is a permission or disk-read error.
  • vx.FileMode.Write - Open the file for writing/saving data. Will create the file if it does not exist. Overwrites an old copy of a file, if one exists. Will fail if there is write-protection or some sort of permission or disk-write error.
  • vx.FileMode.Append - Open the file for writing, BUT preserve all existing data if the file already exists. It will add newly written data to the end of the file.
  • vx.FileMode.WriteAppend - same as above.

[edit] Notes

After opening any file, check vx.File.opened whether it was opened successfully before continuing. Always remember to call vx.File:Close when you're done with it.

Personal tools