FilePos TCL UTILITIES USER MANUAL FilePos
SYNOPSIS
Set the file descriptor to a specific time in a UDF file
PACKAGE
TCLUDF
NAME
FilePos
USAGE
set rV  FilePos  Key Ver Yr Dy Hr Mn Ss {pType} {MustBeIn}]
INPUT DEFINITIONS
Key - The data key associated with the with UDF hierarchy of the opened file. Key should have been obtained from a call to GetDataKey.
Ver - Version number associated this file
Yr - The year being positioned to in the file.
Dy - The day being positioned to in the file.
Hr - The hour being positioned to in the file.
Mn - The minute being positioned to in the file.
Ss - The minute being positioned to in the file.
pType - An optional input used to set the method to position the file descriptor within the file. The default setting is COARSE.
COARSE - Positions the file descriptor to the data record which starts closest to the requested begin time. This is useful in cases where data records contain full logical blocks of data, for example a full spin of data, and one wish to start at the beginning of a spin.
FINE - Positions the file descriptor at the measurement whose start time is closest to the requested begin time.
MustBeIn - An optional input which determines how the file descriptor is set should the requested start time be earlier than the start time of the file. The default setting is 0. With a setting of 0 if the requested beginning time is less than the start of the file the file descriptor is set to the start of the file. A setting of 1 in the same circumstance causes an error status to be returned.
RETURN DEFINITION
1 - ALL_OKAY
-1 - Time beyond end of file
-2 - Time before beginning of file
DESCRIPTION
FilePos positions the file descriptor in the file opened with the same Key and Verson at the either the data record or measurement closed to the requested begin time. The procedure should be called directly after the call to FileOpen. The positioning always fails if the time is beyond the end time of the file and can be made to fail if the time is before the beginning time of the file. Under normal conditions if the time is before the beginning time of the file the file descriptor is positioned at the start of the file. If you are not sure how best to set pType set it to the Blocking flag found in the PIDF. This is the recomended setting.
ERRORS
None Generated
C BACKING
No
EXAMPLE(S)
# POSITION in the  IMAGE orbit data file to 2001 198 1 0 0

# INITIALIZE the UDF common variables

UDFInits

# GET the key for the UDF hierarchy IMAGE IMAGE1 OA ORBIT IMOORBIT

set KeY [GetDataKey IMAGE IMAGE1 OA ORBIT IMOORBIT]

# OPEN the data file containing the time 2001 198 1 0 0

FileOpen $KeY 0 2001 198 1 0 0 2001 198 6 0 0

# POSITION the file pointer to the beginning of the requested time

FilePos $KeY 0 2001 198 1 0 0 
      
Nov 15, 2006