Difference between revisions of "Hsave"

From Scriptwiki
Jump to: navigation, search
 
Line 1: Line 1:
Saves a table to/from a file.
+
Saves a table to a file.
 
  /hsave -sbnioau <name> <filename> [section]
 
  /hsave -sbnioau <name> <filename> [section]
  

Revision as of 20:06, 20 November 2005

Saves a table to a file.

/hsave -sbnioau <name> <filename> [section]

Saves plain text to a text file, with item and data on separate lines. $cr and $lf characters are stripped from text when saving as plain text.

Using the -s switch makes the command display the result (e.g. * Saved hash table 'users' to 'users.dat')

The -b switch saves binary files. $cr and $lf are preserved when saving as binary files.

You can use -n to save files as data only, with no items.

The -o switch overwites an existing file, and -a appends to an existing file.

By default hsave excludes items that are in the /hadd -uN unset list, the -u switch forces it to include the unset items.

The -i switch treats the file as an ini file. You can specify an optional section name after the filename.

Example

hsave users users.dat

This simple example just saves the hashtable users to a file called users.dat.

hsave -so users users.dat

That example would overwrite the file users.dat and show the output.

hsave -ia users users.ini myusers

This would add a new sections to users.ini called myusers and write the hashtable to it.