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

vfsTruncate

 
 

Library: File system utilities (OMVFS) legacy
Include: omvfs.xin

Declaration

  define external function vfsTruncate
           value  vfsFile  file
       at  value  integer  absolute  optional

Argument definitions

file
is the vfsFile object associated with the file to be truncated.
absolute
is the first byte to be deleted.


Purpose

Use vfsTruncate to truncate a file at a specified byte.

Requirements

You must include the following line at the beginning of your OmniMark program:

  include "omvfs.xin"

file must be:

absolute deletes file contents beginning with:

Specifying any other value for absolute will cause an exception to be thrown (external exception VFS209). All bytes from and including the specified position to the end of the file will be removed from the file.

Usage Notes

If absolute isn't supplied, then it defaults to the current cursor position.

If absolute is greater than the current file size, then the file size in increased to absolute and the new file contents are undefined.

External exception VFS300 is thrown for any general OS operation failure. The text accompanying the exception will contain details on the reason for the failure.

Example:

Truncate a file from byte 200 to the end of the file.

  include "omvfs.xin"

  process
     local vfsFile vfsFile2
     set vfsFile2 to vfsOpen "myfile.txt" for vfs-read-write
     vfsTruncate vfsFile2 at 200

        Other Library Functions
   vfsChangeDir
   vfsChangeOwner
   vfsChangePermissions
   vfsClose
   vfsConnect
   vfsConnectDir
   vfsCopy
   vfsCursorPosition
   vfsDeleteDir
   vfsDeleteFile
   vfsDescribe
   vfsDescribeFile
   vfsDir
   vfsDirName
   vfsDisconnect
   vfsFile
   vfsFileDir
   vfsFileName
   vfsIsVersionCompatible
   vfsLibraryVersion
   vfsLink
   vfsList
   vfsLock
   vfsMakeDir
   vfsMove
   vfsMoveCursor
   vfsOpen
   vfsRead
   vfsRename
   vfsTruncate
   vfsUnlock
   vfsWrite
 
 

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

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

Copyright © Stilo Corporation, 1988-2005.