Re: Wanted: Corrisponding command for seek ( C ) in IDL ??? [message #14056] |
Sat, 16 January 1999 00:00 |
mgs
Messages: 144 Registered: March 1995
|
Senior Member |
|
|
In article <77n56e$i1u$1@ultra.csi.unimi.it>, Ospite1
<"ospite1"@a5,itba.mi.cnr.it> wrote:
> --------------4141B0ED49FEECBF3063B6FB
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
> CIAO,
>
> at the moment I am in Italy and short time ago I started learning IDL.
> While I am doing a practical course here for my study, I try to write
> a programm to combine CT and SPECT pictures.
> To do this I first have to change to format of the pictures and I know
> in which bytes of the file the information I need are.
> Unfortunately, I don't know a command to read excatly these bytes.
> I just know that the command in C is 'seek()'.
>
> Is there anyone who can tell me this command.
>
> Hoping for your reply, Ruth
Point_Lun is the IDL analogy to C's seek. From the On-Line help:
POINT_LUN, Unit, Position
Where Unit is the LUN used to open the file
If Unit is positive, Position gives the byte offset into the file at which
the file pointer should be set. For example, to rewind the file to the
beginning, specify 0.
If Unit is negative, Position must be a named variable into which the
current file position will be stored. The returned type will be a longword
signed integer if the position is small enough to fit, and an unsigned
64-bit integer otherwise.
Under VMS, be careful to move the file pointer only to record boundaries.
It is always safe to move to a file position that was previously obtained
via POINT_LUN or the FSTAT function. Files with indexed organization can
only be positioned to the beginning of the file.
Example
To move the file pointer 2048 bytes into the file associated with file
unit number 1, enter:
IDL> POINT_LUN, 1, 2048
To return the file pointer for file unit number 2, enter:
IDL> POINT_LUN, -2, pos
You can then use pos to set a variable for relative moves, such as:
IDL> POINT_LUN, 1, pos + 512
--
Mike Schienle Interactive Visuals, Inc.
mgs@ivsoftware.com http://www.ivsoftware.com/
|
|
|