Skip to content

Get_Channel_Size

Include: Use System\FileSystem.pkg

See Also: Direct_Input, Direct_Output, Get_Channel_Position, Set_Channel_Position, Sequential Channels

Purpose

Returns the size in bytes for an open channel.

Syntax

Get_Channel_Size {ChannelNumber} to {Size}

Size and position are independent. Reading or seeking changes the position, not the size. Use Seq_New_Channel when opening files in application code; see Sequential Channels.

Example

Handle hFile
Integer iSize

Get Seq_New_Channel to hFile
Direct_Input Channel hFile FILE "test1.txt"
Get_Channel_Size hFile to iSize
Close_Input Channel hFile
Send Seq_Release_Channel hFile