Important

   

This documentation space contains information about PATROL Agents when deployed in a TrueSight Operations Management environment. If you are a BMC Helix Operations Management user, see PATROL Agent 22.1 for BMC Helix Operations Management. Open link

ftell()

Return the file position indicator

Syntax

ftell(channel)

Parameter

Parameter

Definition

channel

file I/O channel returned when the file was opened by the fopen() function

Description

The ftell() function returns the file position indicator as the integer number of bytes from the beginning of the file. For an invalid channel, that is, a pipe channel instead of a file channel, the ftell() function returns -1, raises a run-time error, and sets the PSL errno variable. 

The typical result of both the C and PSL versions of the ftell() function is the number of characters written to or read from a file, except on those platforms that perform CR/LF ¤ new-line conversions on text files. However, the value of theftell() function after executing an fseek() function to the end of file is usually the total number of characters in the file. 

The following PSL functions change the file position indicator:

  • fopen()
  • fseek()
  • read()
  • readln()
  • write()

The get_chan_info() function does not change the file position indicator. The close() function makes channel invalid.

Example

This function call returns the current file position indicator for the chan channel:

print(ftell(chan) . "\n");


Was this page helpful? Yes No Submitting... Thank you

Comments