Archive

Name -- Syntax / Description
tar_create
tar_create( file, file_loc, dir, dir_loc, flags )
Creates a compressed Unix style tar file.
Return 1 on success 0 on failure
  • file = target output file
  • location = location of the output file - 'data' or 'script'
  • dir = source directory to create a tarball of
  • dir_loc = location of the source file - 'data' or 'script' defaulting to data
  • flags = may be an empty string or 'compress' which will cause the output .tar file to be bzip2 encoded.
tar_directory
tar_directory( file, location, desc var )
Return information about a tar file.
Number of files in output array, 0 on error
  • filepath = File name and path within the location
  • location = Either "script" or "data". Anything else defaults to "data".
  • desc (out) = An array of structures, one array element for each item in the tar file, with the following members assigned:
  • NAME: Text
tar_extract
tar_extract( file, file_loc, dir, dir_loc )
Unpacks a tar file to a specified directory.
Returns 1 on success 0 on failure
  • file = the path and file name
  • tar_location = source 'data' or 'script'
  • dir = destination directory to extract the tar file to
  • dir_location = destination 'data' or 'script'
wdownload
wdownload( url, filepath, location, callback, callbackdata var )
Downloads and stores a file from a URL. Acts as a front end to wget()
Returns -1 if fails, returns the server response code: Possible examples 200 = success, 301 = moved, 404 = not found.
  • url = file to retrieve
  • filepath = where destination file should be stored
  • location = destination 'data' or 'script'.callback_fn = the name of a callback function in current Miva Script file
  • callback_fn( size, total, data var ): a user defined user function that returns 1 to continue, 0 to abort.
  • callbackdata var = opaque data that is passed as the data parameter to each call of callback_fn
wget
wget( url, filepath, location )
Downloads and stores a file from a URL. Note: If an error occurs, the error message will be stored instead.
Returns -1 if fails, returns the server response code: Possible examples 200 = success, 301 = moved, 404 = not found.
  • url = file to retrieve
  • filepath = where destination file should be stored
  • location = destination 'data' or 'script'.
User Annotations: archive
James R. M. Waters : jwaters at, mivamerchant d0t com
06/29/2012 17:49 p.m.
The callbackdata is a variable passed by reference to the callback function (the "data" parameter) each time it is called.  Useful for maintaining context between each call of the callback function.