HELIOS Base UB for Windows User manual


4 Windows tools

4.1 HELIOS Windows tools

4.1.1 uniconv

This tool converts between different encodings.

The "uniconv" tool is described in detail in the HELIOS Base manual.

4.1.2 dt tools

The HELIOS "dt tools" provide UNIX compatible file management to Windows. "dt" supports UTF-8 parameters and listings, and does not need a command line interpreter to work.

Setting UNIX like file permissions (owner, group, other, mode) can be done from within "dt" and will be translated into Windows ACL permissions. Using "dt tools" within scripts has the advantage that Perl scripts will work on both Windows and UNIX platforms.

The "dt tools" are described in detail in the HELIOS Base manual.

4.1.3 htar

"htar" is a HELIOS implementation of a UNIX tar file compatible archive program. It is designed to handle these features:

"htar" allows moving files between UNIX and Windows and overcomes UNIX tar limitations.

On Windows, file streams and SFM (Services for Macintosh) are used. "dir/file:stream:type" is stored in the archive as "dir/file" and "dir/.rsrc/file:stream:type". SFM Mac Resource/Finder information is converted into the ".rsrc" format while the creation date is preserved.

Usage:

htar [-c|-t|-x] [-z|-Z] [-v] [-k] [-m] [-b,-s blocksize ] [-C <dir>] [-f <file>] [<file|dir> ...]
htar -h (for help info and more options)

The following options can be called with "htar":

-c

Create archive from the given files and directories.

-t

Test archive. "htar" tests the integrity of the entire archive.

-x

Extract archive. "htar" extracts all files in a tar archive.

-z

Create/read "gzip" compressed tar archive.

-Z

Create/read "compress" compressed tar archive.

-v

Print file names when creating or extracting an archive, print detailed information on files when testing an archive.

-k (UNIX only)

Keep Mac file IDs when extracting. Use this option with caution because the file IDs may conflict with file IDs of existing files on a HELIOS volume and "htar" does not add these IDs to the desktop database.

-m

Do not memory map files and tar archives.

-b

Change the tar archive read/write blocking factor, the default archive is 1MB blocking factor. Values can be specified in bytes, 512 byte blocks, kbyte or megabyte blocks, e.g:

-b 1024 (1024 bytes)
-b 10b (10*512 byte blocks)
-b 10k (10*1024 byte blocks)
-b 10m (10*1024*1024 byte blocks)
-s

Change the file read/write blocking factor, the default file
I/O is 1MB blocking factor. Values can be specified in bytes, 512 byte blocks, kbytes or megabytes blocks.

-C <dir>

Change to <dir> before creating/reading an archive.

-f <file>

Use tar archive in <file>. If this option is omitted or given as "-", "htar" reads from standard input (test/extract) or writes to standard output (create).

Examples:

Create an archive of "sample images\template-images%0" in the file "C:\sample-images.tar":

htar -c -f C:\sample-images.tar "sample images
\template-images%0"

Print a verbose listing of the contents of
"C:\sample-images.tar":

htar -t -v -f C:\sample-images.tar

Extract the complete archive "C:\sample-images.tar" into the current working directory:

htar -x -f C:\sample-images.tar

Only extract the folder
"sample images/template-images%0/layouts" from the archive:

htar -x -v -f C:\sample-images.tar "sample images
/template-images%0/layouts"
Note: HELIOS tar archives internally use the UNIX notation with "/" rather than the Windows "\" notation. If "\" were used, the archive would not be recognized.

4.1.4 kill

This tool resembles the UNIX "kill" command on Windows machines. It sends a signal to the HELIOS processes specified by the pid operands.

Usage:

kill [-s signal] pid...
kill -signal pid...
kill -l [signal...]
kill -h help info

The following options can be used with "kill":

-s <signal>

A symbolic signal name specifying the signal to be sent instead of the default TERM.

-signal

A number or a symbolic name specifying the signal to be sent instead of the default TERM.

-l [signal...]

If no operand is given, list the signal names. Otherwise, for signal numbers write the signal names and vice versa.

Examples:

kill -TERM pid Shutdown the process
kill -HUP pid Reconfigure the process
kill -KILL pid Kill the process without
shutdown

4.1.5 ln

The "ln" tool resembles the UNIX "ln" command on Windows machines and creates a new directory entry which points to either a file or a directory that has the same modes as the original file.

Usage:

ln [[-fsn]] <source_file> [<target_file> | <target_dir>]
ln -h help info

The following options can be used with "ln":

-f

If the target file exists, "ln" unlinks it first before creating the link.

-s

Creates a symbolic link.

-n

If the target file or the target directory is a symbolic link, do not follow it (useful with -f).

-h

Display help info

Examples:

Create "data" in the current working directory as a symbolic link to "F:\data":

ln -s F:\data data

Create "myhardlink" as a hard link to "myfile":

ln myfile myhardlink
Note: Symbolic links created by "ln" use a special HELIOS format and are only recognized by HELIOS processes. Symbolic links are different from the Windows "Shortcuts".

Hard links created by "ln" are Windows NTFS hard links. They should only be used with extreme care.

4.1.6 dd

HELIOS "dd" is a BSD-compatible "dd" tool which allows creating, copying, and splitting files. It can be used for benchmarking purposes, and serves as emulation of
"/dev/null" and "/dev/zero".

The "dd" utility copies the standard input to the standard output. Input data is read and written in 512-byte blocks. If input reads are short, input from multiple reads are aggregated to form the output block. When finished, "dd" displays the number of complete and partial input and output blocks and truncated input records to the standard error output.

The following operands can be used with "dd":

Note: On Windows, no "dd" tape device functions are supported.
bs=n

Set both input and output block size to n bytes, superseding the ibs and obs operands. If no conversion values other than noerror, notrunc or sync are specified, then each input block is copied to the output as a single block without any aggregation of short blocks.

cbs=n

Set the conversion record size to n bytes. The conversion record size is required by the record oriented conversion values.

count=n

Copy only n input blocks.

files=n

Copy n input files before terminating. This operand is only applicable when the input device is a tape.

ibs=n

Set the input block size to n bytes instead of the default 512.

if=file

Read input from file instead of the standard input.

iseek=n

Seek on the input file n blocks. This is synonymous with skip=n.

obs=n

Set the output block size to n bytes instead of the default 512.

of=file

Write output to file instead of the standard output. Any regular output file is truncated unless the notrunc conversion value is specified. If an initial portion of the output file is seeked past (see the oseek operand), the output file is truncated at that point.

oseek=n

Seek on the output file n blocks. This is synonymous with seek=n.

seek=n

Seek n blocks from the beginning of the output before copying. On non-tape devices, an lseek operation is used. Otherwise, existing blocks are read and the data discarded. If the user does not have read permission for the tape, it is positioned using the tape ioctl function calls. If the seek operation is past the end of file, space from the current end of file to the specified offset is filled with blocks of NUL bytes.

skip=n

Skip n blocks from the beginning of the input before copying. On input which supports seeks, an lseek operation is used. Otherwise, input data is read and discarded. For pipes, the correct number of bytes is read. For all other devices, the correct number of blocks is read without distinguishing between a partial or complete block being read.

-v

Display the HELIOS "dd" version number.

conv=<value>

Where <value> can be one of the following parameters:

Usage:

dd conv=<value_1>,<value_2>,<...>
noerror

Do not stop processing on an input error. When an input error occurs, a diagnostic message followed by the current input and output block counts will be written to the standard error output in the same format as the standard completion message. If the sync conversion is also specified, any missing input data will be replaced with NUL bytes (or with spaces if a block oriented conversion value was specified) and processed as a normal input buffer. If the sync conversion is not specified, the input block is omitted from the output.

On input files which are not tapes or pipes, the file offset will be positioned past the block in which the error occurred using lseek.

notrunc

Do not truncate the output file. This will preserve any blocks in the output file not explicitly written by "dd". The notrunc value is not supported for tapes.

osync

Pad the final output block to the full output block size. If the input file is not a multiple of the output block size after conversion, this conversion forces the final output block to be the same size as preceding blocks for use on devices that require regularly sized blocks to be written. This option is incompatible with use of the bs=n block size specification.

sparse

If one or more output blocks would consist solely of NUL bytes, try to seek the output file by the required space instead of filling them with NULs, resulting in a sparse file.

sync

Pad every input block to the input buffer size. Spaces are used for pad bytes if a block oriented conversion value is specified, otherwise NUL bytes are used.

unblock

Treats the input as a sequence of fixed length records independent of input and output block boundaries. The length of the input records is specified by the cbs operand. Any trailing space characters are discarded and a newline character is appended.

Where sizes are specified, a decimal, octal, or hexadecimal number of bytes is expected. If the number ends with a "b", "k", "m", "g", or "w", the number is multiplied by 512, 1024 (1K), 1048576 (1M), 1073741824 (1G) or the number of bytes in an integer, respectively. Two or more numbers may be separated by an "x" to indicate a product.

When finished, "dd" displays the number of complete and partial input and output blocks, truncated input records and odd-length byte-swapping blocks to the standard error output. A partial input block is one where less than the input block size was read. A partial output block is one where less than the output block size was written. Partial output blocks to tape devices are considered fatal errors. Otherwise, the rest of the block will be written. Partial output blocks to character devices will produce a warning message. A truncated input block is one where a variable length record oriented conversion value was specified and the input line was too long to fit in the conversion record or was not newline terminated.

Normally, data resulting from input or conversion or both are aggregated into output blocks of the specified size. After the end of input is reached, any remaining output is written as a block. This means that the final output block may be shorter than the output block size.

DIAGNOSTICS

The "dd" utility exits "0" on success, and ">0" if an error occurs.

Examples:

Copy file with a block size of 512 bytes:

dd if=input_file of=output_file bs=512

Create 100 MB file with 100 blocks of 1024 KB:

dd if=/dev/zero bs=1024k count=100 of=output_file

Read 100 MB file with a block size of 1024 kB:

dd if=input_file of=/dev/null bs=1024k

4.1.7 crontool

This tool is used to add scheduled jobs on Windows machines to the Windows Scheduled Tasks menu (Start > Control Panel > Scheduled Tasks). It can start and stop specified programs at midnight.

Usage:

In the "HELIOSDIR\sbin" directory

crontool [-i <command>] [-u <command>] [-l]

The following options can be used with "crontool":

-i

Schedule job to run at a specified time each day.

-u

Remove job from the list of scheduled commands.

-l

Print the list of scheduled commands. Another way to print this list is with the Windows "at" command.

Examples:

Schedule "C:\Program Files\My Company\mycronjob.bat" to run at 00:00 each day:

crontool -i "/C:/Program Files/My Company/mycronjob.bat"

Remove the above job from the list of scheduled commands:

crontool -u "mycronjob.bat"
Note: A simpler way to execute daily jobs is to place a Perl script into the "HELIOSDIR\etc\daily" folder.

4.1.8 psyslog

"psyslog" is a tool to browse syslog entries. Records will be read from syslog entries in the Windows Event Viewer. All records will be mixed into one list so that records appear in chronological order. "psyslog" will print all events of the current day unless it is overridden with the -d parameter.

Called with the -f parameter, "psyslog" is not stopped when the end of the syslog file has been reached. It waits for additional data to be appended, instead.

"psyslog" is described in detail in the HELIOS Base manual.

4.2 Third-party Windows tools

4.2.1 Sysinternals tools for Windows

There are three monitoring tools by Sysinternals that are recommended for using HELIOS products on a Windows platform: FileMon, Regmon and Process Explorer.

For installation and use of the tools, please see the Sysinternals website (www.sysinternals.com).

FileMon

While UNIX systems offer built-in file monitoring tools (e.g. truss, strace, sc_usage, ktrace), FileMon monitors and displays file system activity on a Windows system in real-time. It is a powerful tool for exploring the way Windows works, seeing how applications use the files and DLLs, or tracking down problems in system or application file configurations. A timestamping feature precisely logs when every open, read, write or delete, happens, and its status column informs about the outcome. It has full search capability, while the output can be filtered to reduce the information to the essential.

Regmon

Regmon is a monitoring utility that shows which applications are accessing the Windows Registry, which keys they are accessing, and the Registry data that they are reading and writing - all in real-time. Static tools show what Registry values and keys changed. Regmon logs how the values and keys changed.

Process Explorer

Process Explorer shows information about which handles and DLLs processes have opened or loaded.

The Process Explorer display consists of two sub-windows. One window always shows a list of the currently active processes, including the names of their owning accounts, whereas the information displayed in the other window depends on the mode that Process Explorer is in: handle mode or DLL mode. Process Explorer also has a powerful search capability that will quickly show which processes have particular handles opened or DLLs loaded.

4.2.2 Wireshark Network Analyzer

Network Analyzer

Wireshark (formerly known as "Ethereal") is used by network professionals around the world for troubleshooting analysis, software and protocol development, and education.

For installation and use of the tools, please see the Wireshark website (www.wireshark.org).


© 2006 HELIOS Software GmbH