TAPEFILE

Tape/File Catalogue and dump Version: 2.1

BETA TEST - RELEASED FOR TESTING PURPOSES

SOME FEATURES ARE NOT IMPLEMENTED

THIS HTML FILE IS STILL UNDER CONSTRUCTION

PROGRAM HAS NOT BEEN THOROUGHLY TESTED - PLEASE CHECK ALL RESULTS CAREFULLY AND REPORT PROBLEMS TO chas@lynxinfo.co.uk

Introduction

TAPEFILE is a utility program for examining, modifying and copying all kinds of files on disk or tape. TapeFile Version 2.0 was developed from Lynx's 3S MSDOS utility of the same name, discontinued after 10 years at version 1.43. When used with Lynx's TracePro seismic processing software, TapeFile enables SEG-Y tapes to be imported and exported to disk. Users of 3S TapeFile will be familiar with the general philosophy and operation of the Windows version.

The source and destination files can be on disk, or on a tape device connected to the PC via an Adaptec SCSI interface card.

Features of TapeFile



Running TapeFile

To use TapeFile, you must always select an input device, either a tape or a file, from the Input menu. If you want to copy data to another file or tape, then you must also select an output device. To examine, or "dump", files or tapes, you only need to select an input. Tapefile uses the concept of "blocks" to subdivide tapes and disk files. In the case of tapes, the blocks correspond to the physical blocks of data written sequentially on the tape. For files, blocks are a convenient way of subdividing a file into manageable pieces.

The screen shot below is of a TapeFile dump of a Lynx format seismic trace file.

Commonly used TapeFile actions are grouped on the main tool bar. These actions can also be invoked from the main menu. Buttons for stepping through files and blocks are on the tool bar.

Menus and Controls

Input

The Input main menu option defines the input device, file or tape, from which data are read.

File Select an input file, for dumping or copying to an output device

Tape Select an input tape. If no tapes appear in the Select Tape Device list, check that the tape drive is properly connected and switched on. Check that the SCSI interface is correctly installed and set up - see the section on Startup and Configuration.

If the tape is already selected as an output device, then you cannot select it as an input tape (and vice versa). To copy a tape, when you only have one tape drive, see Copying Tapes

Select a tape drive for input.

Rewind the input tape to the beginning of the media.

Skip Files. Enter the required number of files to skip. A negative number will skip backwards, towards the beginning of the tape.

Skip Blocks Enter the required number of blocks to skip. A negative number will skip backwards, towards the beginning of the tape, until the beginning of the current file is encountered.

Folder Select a folder from which input disk files will be taken when performing operations on multiple files, such as copy to tape.

Dump

The Dump main menu option controls dump display and search and replace operations

View displays the dump of the current block, in the format determined by options below.

Options Displays the Dump Options parameter page, which controls the appearance of the dump, data translation etc.

Block search displays the dump search criteria and initiates the search. This type of search is designed for tape media or block structured disk files, when you want to find data which always occur at a particular position (address, offset) within the block.

Random search and replace displays search criteria for finding particular byte sequences within a file and replacing them if required. (disk files only)

Block and File control

Previous file Skip to previous file

Beginning of file Skip to beginning of file. Tapes are positioned before the first block.

Previous record go to the previous block.

Next record go to the next block

End of file go to the end of the file

Next file go to the beginning of the next file

Stop current i/o operation

Output

The Output main menu option enables the output device or folder to be selected

Tape Select an output tape drive from the list. Remember to "write enable" a new tape and load it into the drive.

Select a tape drive for o/p.

Rewind the output tape.

Skip Files Enter the required number of files to skip. A negative number will skip backwards, towards the beginning of the tape

Skip Blocks Enter the required number of blocks to skip. A negative number will skip backwards, towards the beginning of the tape, until the beginning of the current file is encountered.

Select Folder to which files are to be output.

Copy

The Copy main menu option controls copying from the selected input to the selected output device. The possible copying operation is controlled by the types of device selected for input and output. If the input device is a tape and the output is dsik, then Tape to Disk will be enabled and so on.

Options Set the options for the currently enabled copying operation.

Disk to Tape Copy using the parameters set under Options, Set disk to tape copying mode

Tape to disk Copy using the parameters set under Options, Set tape to disk copying mode

Disk to Disk NOT IMPLEMENTED

Tape to tape NOT IMPLEMENTED



TapeFile Parameters

Page index


Set Dump Options

Translation mode
(type option TEXT,HEX,INT2,INT4,IEEE-FLT,IBM-FLT,INT2REV,INT4REV,IEEE-FLTREV)
In the data display part of the dump, on the right hand side of the screen, binary data will be translated and displayed using one of the above data types. See supported data types.

Text translation
(type option, limits ASCII,EBCDIC,ASCII)
Determine how the text part of the dump will be displayed
ASCII - no conversion before display
EBCDIC - bytes are passed through EBCDIC to ASCII conversion before display.

Show Addresses in
(type option, limits Decimal,HEX)
The addresses displayed at the beginning of each line can be displayed as decimal or Hexadecimal.

Addrs relative to
(type option, limits File,Block)
File- addresses are displayed relative to the beginning of the current file
Block- addresses are displayed relative to the beginning of the current block, i.e. the address starts from zero at the top of the dump.

Block size
(type long integer, limits 1,32767)
For a disk file, determines the logical block size used when dumping the file, i.e. the number of bytes displayed in each page of the dump. For a tape file, the block size limits the amount of data displayed in a page to this number of bytes.

Offset within Block
(type long integer, limits 0,32767)
The data translation specified in Translation Mode above assumes that start of the block coincides with the first byte of a value of that type and that subsequent values occur contiguously. Apply an offset here to shift the data so that you can translate values that do not coincide with the correct byte boundaries.

Offset within File
(type long integer, limits 0,2000000000)
Enter a value here to specify a number of bytes to be skipped at the start of a file. This is useful for disk files which are representing a variable-length blocking structure such as SEG-Y.


Block search criteria

When dumping data from disk or tape

Offset within block
(type long integer, limits 0,100000)
data at this offset, in bytes, from the beginning of each block are compared with the value entered below.

Data type expected at the offset above.
(type string, limits TEXT,HEX,INT2,INT4,IEEE-FLT,IBM-FLT,INT2REV,INT4REV,IEEE-FLTREV)
The format in which the search values are entered. See supported data types. The search value is converted to binary, according to the type selected here

Condition
(type string, limits EQ,NE,LE,LT,GE,GT)
The data at the specified offset, within each block, will be compared with the value entered below, after the value has been translated into binary, according to the selected data type. The comparison operators are
EQ - value = data
NE - value <> data
LE - value <= data
LT - value < data
GE - value >= data
GT - value > data

Value
(type string)
search value entered as a string, of the data type specified above. The value will be translated to binary before the comparison, according to the data type.

By combination
(type string, limits NONE,AND,OR)
a second condition can be applied to the search and combined with the first
NONE - no second condition. Parameters below are ignored
AND - combine the search conditions, using logical AND
OR - combine the search conditions, using logical OR

Offset within block
(type long integer, limits 0,100000)
data at this offset, in bytes, from the beginning of each block are compared with the value entered below.

Data type at offset
(type string, limits TEXT,TEXT,HEX,INT2,INT4,IEEE-FLT,IBM-FLT,INT2REV,INT4REV)
The format in which the search values are entered. See supported data types. The search value is converted to binary, according to the type selected here

Condition
(type option EQ,NE,LE,LT,GE,GT)
see above

Value
(type string, limits )
search value entered as a string, of the data type specified above. The value will be translated to binary before the comparison, according to the data type.

Ignore case
(type option No,Yes)
When doing text searches,
Yes - ignore the case of the characters, in the comparison
No - the case must match.

Text type
(type option ASCII,EBCDIC)
When doing text searches,
ASCII - use ASCII characters, as entered,
EBCDIC - translate the entered characters into EBCDIC for the comparison.


Set output file names

When copying from tape to disk, use this page to determine how the output files will be named. The files will be created in the folder detemined by the output folderselection

No. of files to create
(type long integer, limits 1,100000)
Read this number of files, or continue until the end of the tape is reached, whichever is the smaller number.

File name ROOT
(type string, default Tape_)
Files will be created sequentially with names of the form Tape_nnnn.EXT, where Tape_ is the root name entered here and nnnn is an integer member of an output numbering sequence, determined from the starting number and increment number below.

Starting number
(type long integer, limits 0,100000)
The number at which to start the output file numbering sequence nnnn

Increment number
(type long integer, limits 1,100000)
The increment to add to nnnn when outputting a new file.

Extension EXT
(type string, default TAP)
The file extension .EXT for the ouput files.

Existing files
(type option SKIP,OVERWRITE)
Determines what TapeFile will do if an output file name already exists in the output folder
SKIP - increment nnnn until a filename is found which does not exist
OVERWRITE - overwrite the existing file.


Tape to Disk copy options

File type
(type option General,SEG-Y)
General - most input file types with fixed or variable block lengths
SEG-Y format tapes, enables SEG-Y copying options

Copy all of (each) file
(type option No,Yes)
No - copy part of the file, controlled by parameters below.
Yes - copy all of the file to disk

Copy from
(type options block,search,BOF)
block - specify the number of the blocks to skip at the start of the tape, before copying subsequent blocks.
search - specify search criteria to find the block at which to start copying.
BOF - start copying at the first block, block zero, or Beginning Of File

Blocks to skip at start
(type integer, limits 0,1000000)
The number of blocks to skip before copying starts. Entering zero here is equivalent to the BOF option above.

Copy until
(type option, block,search,EOF)
block - specify the number of the blocks to copy.
search - specify search criteria to find the block at which to stop copying.
EOF - stopy copying at the last block, End Of File.

Blocks to copy
(type integer, limits 0,1000000)
The number of blocks to copy.

Save block structure
(type option No,Yes)
No - do not save the block structure
Yes - save the block structure, i.e. save a definition of the lengths of the individual blocks as they are copied from the input tape. This can be used to recreate an exact copy of the input file, with the correct block structure, on an output tape. This means that tapes can be copied when only one tape drive is available.

Block structure file
(type string)
Enter the name of the file in which to save the block structure of the input tape.


Start and End copy, search criteria

When copying block structured tapes, such as SEG-Y, these criteria can be used for extracting a specific range of blocks from a file on tape and copying them to disk. The same criteria can be used either to determine the start, or the end of copying. In either case, the block at which the start, or end, criterion first becomes true will be included in the copied file.

Offset within block
(type long integer, limits 0,100000)
The offset in bytes from the beginning of each block, at which the search will be made.

Data type at offset
(type option TEXT,HEX,INT2,INT4,IEEE-FLT,IBM-FLT,INT2REV,INT4REV,IEEE-FLTREV)
The value entered below is converted to binary using the data type specified here to translate the value into binary bytes, for comparison with the corresponding bytes from the input block. See supported data types.

Condition
(type string, limits EQ,EQ,NE,LE,LT,GE,GT)
The data at the specified offset, within each block, will be compared with the value entered below, after the value has been translated into binary, according to the selected data type. The comparison operators are
EQ - value = data
NE - value <> data
LE - value <= data
LT - value < data
GE - value >= data
GT - value > data

Value
(type string, limits )
search value entered as a string, of the data type specified above. The value will be translated to binary before the comparison, according to the data type.

By combination
(type options NONE,AND,OR)
a second condition can be applied to the search and combined with the first
NONE - no second condition. Parameters below are ignored
AND - combine the search conditions, using logical AND
OR - combine the search conditions, using logical OR

Offset within block
(type long integer, limits 0,100000)
The offset in bytes from the beginning of each block, for the second condition, at which the search will be made.

Data type at offset
(type option TEXT,HEX,INT2,INT4,IEEE-FLT,IBM-FLT,INT2REV,INT4REV)
The value entered below, for the second condition, is converted to binary using the data type specified here to translate the value into binary bytes, for comparison with the corresponding bytes from the input block. See supported data types

Condition
(type option EQ,NE,LE,LT,GE,GT)
The data at the specified offset, within each block, will be compared with the value entered below, after the value has been translated into binary, according to the selected data type.

Value
(type string, limits )
search value entered as a string, of the data type specified above. The value will be translated to binary before the comparison, according to the data type.

Ignore case
(type option No,Yes)
When doing text searches,
Yes - ignore the case of the characters, in the comparison
No - the case must match

Text type
(type option ASCII,EBCDIC)
When doing text searches,
ASCII - use ASCII characters, as entered,
EBCDIC - translate the entered characters into EBCDIC for the comparison.


SEGY tape loading options

When copying drom tape to disk and file type option is SEG-Y, this page will be enabled.

Saved SEG-Y header
(type option No,Yes)
No - the SEG-Y disk file will have the SEG-Y header read from the tape in the normal way.
Yes - before reading any blocks from tape, the SEG-Y header (EBCDIC and binary) will be obtained from the source specified below and written to the output file. The first and subsequent blocks read from the tape are assumed to be SEG-Y traces, compatible with the chosen header. This enables large files on tape to be split into two or more smaller files, each using the same SEG-Y header.

Using a saved SEG-Y header in this way allows a header to be prepended to (stuck on the beginning of) a set of seismic traces read from the middle of a tape. This enables large SEG-Y 3-D volumes on tape to be split into more manageable sized chunks, each having a SEG-Y header (EBCDIC and Binary) copied from the beginning of the tape.

SEG-Y header source
(type option Tape,File)
Tape - (this option not implemented)
File - specify the SEG-Y disk file below, used to supply a SEG-Y header

SEG-Y Header from file
(type string)
Select a SEG-Y file which will supply the header for subsequent trace blocks read from tape.


Set Disk to Tape copy mode

File type
(type option, General,SEG-Y)
type of tape to generate
General - all tapes, except SEG-Y
SEG-Y - copy seismic trace files in SEG-Y format to SEG-Y format tape.

Blocking
(type option Fixed,Variable)
Blocking can be
Fixed - all blocks on the tape are the same length, specified below.
Variable - blocks on tape have variable lengths, as defined in the Block definition file, specified below.

Block definition
For variable blocking, select a file containing the block list definition, of type *.CSV

Fixed block size
(type long integer, limits 1,32768)
For fixed blocking, enter the required blocksize, in bytes.

Split i/p file
(type option, No,Yes)
The input file can optionally be split, at a byte or block boundary specified below. This parameter also determines whether the amount to copy, if specified, is in blocks or bytes.
No - copy entire file
Yes - split the file.

Start copying at
(type option byte,block)
If the i/p file is to be split, specify
byte - file will be split at a byte boundary
block - file will be split at a blocke boundary.

Byte/block
(type long integer, limits 0,2000000000)
The first byte, or block, to be output from the input file. The byte and block numbers are 0-based, i.e. the first block in the file is block 0.

Amount to copy
(type option, Some,All)
Specify how much data to copy from the point at which copying starts
Some - specify below how many blocks or bytes to copy
All - copy all of the data after the point at which copying starts

Bytes/blocks
(type long integer 0,2000000000)
The number of bytes, or blocks, to copy, after the point at which copying starts


Find and replace

Use this option for searching for and replacing bytes in input files. Unlike the block search, this does not require any offset to be specified and will search across block boundaries.

Data type
(type option TEXT,HEX,INT2,INT4,IEEE-FLT,IBM-FLT,INT2REV,INT4REV)
The value entered below is converted to binary using the data type specified here to translate the value into binary bytes, for searching for the corresponding bytes from the input file. See supported data types.

Value
(type string, limits )
search value entered as a string, of the data type specified above. The value will be translated to binary before the comparison, according to the data type.

Start search at
(type option BOF,current position)
BOF - start the search at the beginning of file.
Current position - start the search at the beginning of the current block.

Replace
(type option Search only, replace)
Search only - search for the required value and display the block in which it occurs
replace- if the search is successful, replace the found value with the one below.

Value
(type string )
The value to replace the search bytes.



Errors and Messages

Bad hexadecimal string - the hexadecimal string must contain only characters 0..9 and A..F

Invalid numeric field - the numeric field contains non-numeric characters, or embedded blanks

SEG-Y header block length mismatch - SEG-Y header blocks should have lengths of 3200 (EBCDIC header) and 400 bytes (binary header)

Error: Incorrect block length for binary file header - binary file header block length for SEG-Y should be 400 bytesebinblock

Folder path not found. Using current folder - The folder path saved in the program parameter file is no longer valid. The program will use the "current folder" as determined by the operating system.

Drive is already set - The tape drive has already been selected. You can't select the same tape drive for both input and output!

Error writing file - a general file i/o error was reported by the operating system.

Error: Illegal sample format code - Unrecognised format code read from file header.

A match was not found - when searching, no match was found between the search criterion and data in the file

Sorry, cannot replace data on tape - Find and replace only works with disk files

Error: Not a SEG-Y file - The file does not have the expected SEG-Y header information

SEG-Y header not found - The file does not have the expected SEG-Y header information

Error: Incorrect block length for trace data - The trace data block was not of the expected length



Supported Data Types

The following data types are supported in TapeFile. These conversions are used for display, in the Dump menu, and for entering search values when performing block and random searches.

TEXT - text, from single byte ASCII or EBCDIC coded characters.
HEX - hexadecimal. Each byte is depicted as a pair of hexadecimal numbers, in the range 00..FF. The characters 0..9 have their usual meanings and A..F represent hexadecimal digits 10 to 15
INT2 - Little endian signed 2-byte integer. Integers written by an Intel/Microsoft system will display correctly.
INT4 - Little endian signed 4-byte integer. Integers written by an Intel/Microsoft system will display correctly.
IEEE-FLT - IEEE 4-byte floating point number, single precision, little-endian.
IBM-FLT- IBM 360 type 4-byte floating point number, as used in SEG-Y floating point.
INT-2(REV) - Big endian signed 2-byte integer.
INT-4(REV) - Big endian 4-byte integer.
IEEE-FLT(REV) - IEEE 4-byte floating pointing point number, single-precision, big-endian

In a big-endian system, the most significant value in the sequence is stored at the lowest storage address (ie first). In a little-endian system, the least significant value in the sequence is stored first.

Many modern computers, including PCs, use the little-endian system. Many mainframe and Unix based computers, particularly IBM mainframes, use a big-endian architecture. Converting data between the two systems is sometimes referred to as the NUXI problem. Imagine the word UNIX stored in two 2-byte words. In a Big-Endian systems, it would be stored as UNIX. In a little-endian system, it would be stored as NUXI.

The bit ordering within each byte can also be big- or little-endian, and some architectures actually use big-endian ordering for bits and little-endian ordering for bytes, or vice versa.

The terms big-endian and little-endian are derived from the Lilliputians of Gulliver's Travels, whose major political issue was whether soft-boiled eggs should be opened on the big side or the little side. Likewise, the big-/little-endian computer debate has much more to do with political issues than technological merits. You have been warned!