BARfly Help - Node editing - Saving files

  Saving Files

This page describes content of the BARfly Silver and BARfly Gold builds.

You can save a data file you are working on just like you would in any other desktop application.  Select File.Save File to save the file to the disk using its existing name.  You can also save the file under a different name by selecting File.Save File As.

If you choose to save a file under a different name, the dialog box to the left pops up.  Pick a name and press the "Save" button to save the file under a new name.

You can also select the data format in which you are saving the file.  By default, BARfly chooses to save in binary format, which is the format dictated by the I.F. itself.  However, you get three additional choices, chosen from the "Save as type" combo box below the name:  USS, UTD, and XML.

USS - Universal State Save

A Universal State Save is a type of "omni" format that guarantees that the data file's contents will reload in a fashion that matches the original representation in BARfly.  The data remains in binary format, but the serialization (and deserialization) procedures of the I.F. are not used during loading and saving.  Instead, the result is the same as if you had copied the top-level node to the clipboard before the save operation, and pasted it again as part of a future load operation.

USS increases the size of the file by a small amount to keep the data format consistent.  If you have doubts about the ability of an I.F. to conduct deserialization or serialization correctly, you can employ USS as an alternative storage format.  It is also entirely possible to use just USS for storage if you had not wanted to give any thoughts about designing a deserialization or serialization procedure for an I.F.

USS is not guaranteed to reload successfully if the I.F. used in the serialization process is heavily modified before the file is deserialized again.  This follows naturally from the construct parallels restrictions on copying and pasting node data--file formats that are too dissimilar cannot be reconciled.

UTD - Universal Text Dump
XML - Extensible Markup Language

You can save the contents of a data file as a text dump in either UTD or XML format.  Basically, what is saved to the disk is the equivalent of dump view invoked for the top-level node.  You can learn more about these dumped formats here.


 Issues with Reloading Files

A well-formed I.F. will seamlessly deserialize a file in exactly the way it was serialized to the disk.  However, not all file formats allow for this.  Some file formats are nonlinear in nature, and the only way to ensure file format integrity might be to write the data to disk in a different order or format than what it was loaded from.

Furthermore, it is not always the intent of an I.F. to keep input and output consistent in this manner.  Some implementation files are designed with an explicit one-way conversion in mind:  you can deserialize, but serialization is not guaranteed to work (or vice versa).

The Run.Revalidate menu item can help ensure validity, but it does not ensure consistency.  The only foolproof way to ensure consistency in how the data are represented in BARfly is to save in USS, UTD, or XML formats.


 Advanced Save Settings

There are some options you can set for data file saving in Options.Data File Save Settings that directly affect how data files are saved:

  • No Truncation:  By default, BARfly destroys the previous contents of a file on the disk, if it existed, before trying to save over it.  With this box checked, BARfly will not truncate the existing file.  Instead, the contents of the file are overwritten starting from the first existing byte of the file.  If any portion of the existing file on the disk is not overwritten, it remains as it was before the save operation.  This is often a good way to update database-oriented formats, which might entail only incremental "record updates" instead of a complete rewrite of the entire file.
  • Revalidate before saving:  You can automate the execution of the Run.Revalidate menu item as part of the save process.  If the revalidation passes, the file is saved.  If the revalidation fails, the file is not saved.


  See also: [Undo/Redo capability] [Finding and replacing data] [Limits to node editing]


BARfly Help Copyright © 2009 Christopher Allen