swirl
Guide to OmniMark 7   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax     Other Library Functions  
function  

vfs.move-cursor

 
 

Library: General, File system utilities (OMVFS)
Import: omvfs.xmd

Declaration

  export external function move-cursor
          of      value file file-ref
          by      value integer offset optional
          to      value integer absolute optional

Argument definitions

file-ref
A vfs.file object representing the file in which the cursor is to be moved.
offset
The distance to move the cursor relative its current position.
absolute
The absolute position to move the cursor to.


Purpose

You can use vfs.move-cursor to change the position at which the next read of a file will occur. The position may be specified either relative to the current cursor position, or as an absolute position in a file. For instance, if you know that the data you are interested in starts at byte 100 in a file, you can read from that position like this:

  import "omvfs.xmd" prefixed by vfs.

  process
     local vfs.file test-file
     set test-file
      to vfs.open "c:/omnimark/projects/testfile.txt"
     vfs.move-cursor of test-file to 100
     output vfs.reader of test-file

You must specify either a relative or absolute movement, and not both.

Exceptions

The following exceptions may occur:

    Related Syntax
   vfs.writer
   vfs.cursor-position
   vfs.file
 
  Other Library Functions
   vfs.change-directory
   vfs.change-owner
   vfs.change-permissions
   vfs.close
   vfs.connect
   vfs.connect-directory
   vfs.copy
   vfs.cursor-position
   vfs.default-certificates-file
   vfs.delete-directory
   vfs.delete-file
   vfs.describe
   vfs.describe-file
   vfs.directory
   vfs.directory-name
   vfs.disconnect
   vfs.file
   vfs.file-directory
   vfs.file-name
   vfs.link
   vfs.list
   vfs.lock
   vfs.make-directory
   vfs.move
   vfs.move-cursor
   vfs.omvfs-version
   vfs.open
   vfs.open-file-system
   vfs.open-ftp
   vfs.open-http
   vfs.open-https
   vfs.reader
   vfs.set-default-certificates-file
   vfs.truncate
   vfs.unlock
   vfs.writer
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACYLIBRARIES ] [ ERRORS ]

OmniMark 7.1.2 Documentation Generated: June 28, 2005 at 5:46:02 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © Stilo Corporation, 1988-2005.