This page was created by the IDL library routine `mk_html_help2`.

Last modified: Mon Aug 25 17:03:10 2025.

# Directory Listing of Routines

# general/misc/file_stuff

- FILE_CHECKSUM
- GENERATE_CHECKSUMS
- SOCKET_READER__DEFINE[1]
  This tool is a generic multi purpose object that can read data from:
- SOCKET_READER__DEFINE[2]
- SOCKET_RECORDER__DEFINE
  Widget tool that opens a socket and records streaming data from a server (host) and can save it to a file

# Routine Descriptions

## FILE_CHECKSUM

[Next Routine] [List of Routines]

    function FILE_CHECKSUM
    Purpose: Returns: SHA1 CHECKSUM string for a file
    Usage:
        output = file_checksum( filename, [/add_mtime] )
    Typical usage:
        file_hash( file_search('*') ,/add_mtime )  ;
     Origin:  Mostly copied from file_touch
     Limitations:
        Currently works only on Linux and MacOs systems by calling the shasum command in a shell.
        This module is under development.
     Author: Davin Larson (davin@ssl.berkeley.edu)  copyright - March 2014
     Changes:
        December 2014 - Name changed from file_hash to file_checksum because is better reflects its true purpose
     License:
       All users are granted permission to use this unaltered code.
       It may NOT be modified without the consent of the author. However the author welcomes input for bug fixes or upgrades.

     $LastChangedBy: ali $
     $LastChangedDate: 2021-05-30 19:47:43 -0700 (Sun, 30 May 2021) $
     $LastChangedRevision: 30011 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/misc/file_stuff/file_checksum.pro $

(See general/misc/file_stuff/file_checksum.pro)

## GENERATE_CHECKSUMS

[Previous Routine] [Next Routine] [List of Routines]

    Procedure generate_checksums
    Purpose: recursively creates checksum files in subdirectories.
        These files are produced using the "shasum" program. The same program can be used to check file integrity
        Files are not regenerated if the chksum file is newer than all of its dependents.
    Usage:
    Typical usage:
        generate_checksums,directorypath,FILE_PATTERN='*.cdf'
        input:  directorypath - scaler string  filepath (must end with '/')

        FILE_PATTERN :  string(s)   file format string(s) use for search. Defaults to '*'
        DIR_PATTERN :  string(s)   directory format to be searched  recursively  [optional]

        RECURSE_LIMIT :  default is 10.  Set to 0 to create a single checksum file containing all files found.

        FORCE_REGEN : Set this keyword to force regeneration of all checksums
        INCLUDE_DIRECTORY : Set this keyword to compute the checksum of the checksum files in subdirectories.
        FULL_PATH : set this keyword to include the full path in the checksum file. (not recommended)

        VERBOSE:  set verbosity level

     Limitations:
        Currently works only on Linux and MacOs systems by calling the shasum command in a shell.
        This module is under development.
     Author: Davin Larson (davin@ssl.berkeley.edu)  copyright -October 2015
     Changes:
     License:
       All users are granted permission to use this unaltered code.
       It may NOT be modified without the consent of the author. However the author welcomes input for bug fixes or upgrades.

     $LastChangedBy: ali $
     $LastChangedDate: 2021-05-30 19:48:04 -0700 (Sun, 30 May 2021) $
     $LastChangedRevision: 30012 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/misc/file_stuff/generate_checksums.pro $

(See general/misc/file_stuff/generate_checksums.pro)

## SOCKET_READER__DEFINE[1]

[Previous Routine] [Next Routine] [List of Routines]

    Procedure:
      socket_reader
    PURPOSE:
     This tool is a generic multi purpose object that can read data from:
        1)  regular files
        2)  data streams (a socket)
        3)  array of bytes
      It will optionally record data to a file

      It is typically used by a higher level object which inherits the methods and possibly overload some of the methods.
      In particular the following object all call this object:
        cmblk_reader()   ; reads common block data (files or sockets) that typically contain all of the following data types
        ccsds_reader()   ; reads ccsds packet data (files or sockets)
        ccsds_frame_reader()  ; reads ccsds frame data  (still in development)
        json_reader()         ; reads json files
        gsemsg_reader()       ; reads SSL "silver box" (swemulator or swifulator output)
        ascii_reader()        ; ascii text files with each line of text ending with a newline character.

        It is very common for a hierarchy of nested streams to exist in a single file or stream.

     Widget tool that opens a socket and reads streaming data from a server (host) and can save it to a file
     or send to a user specified routine. This tool runs in the background.
     Keywords:
       file_timeres : defines how often the current output file will be closed and a new one will be opened
       DIRECTORY:  string prepended to fileformat when opening an output file.
     Author:
        Davin Larson - January 2023
        proprietary - D. Larson UC Berkeley/SSL

     $LastChangedBy: rjolitz $
     $LastChangedDate: 2025-03-04 10:57:07 -0800 (Tue, 04 Mar 2025) $
     $LastChangedRevision: 33161 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/misc/file_stuff/socket_reader__define.pro $

(See general/misc/file_stuff/socket_reader__define.pro)

## SOCKET_READER__DEFINE[2]

[Previous Routine] [Next Routine] [List of Routines]

     :Description:
        Describe the procedure.

     :Params:
        source

     :Author: davin

(See general/misc/file_stuff/socket_reader__define.pro)

## SOCKET_RECORDER__DEFINE

[Previous Routine] [List of Routines]

    WIDGET Procedure:
      socket_recorder
    PURPOSE:
     Widget tool that opens a socket and records streaming data from a server (host) and can save it to a file
     or send to a user specified routine. This tool runs in the background.
     Keywords:
       SET_FILE_TIMERES : defines how often the current output file will be closed and a new one will be opened
       DIRECTORY:  string prepended to fileformat when opening an output file.
     Author:
        Davin Larson - April 2011
        proprietary - D. Larson UC Berkeley/SSL

     $LastChangedBy: davin-mac $
     $LastChangedDate: 2016-09-28 22:56:26 -0700 (Wed, 28 Sep 2016) $
     $LastChangedRevision: 21979 $
     $URL: $

(See general/misc/file_stuff/socket_recorder__define.pro)