目录

sysseek

描述 (Description)

此功能根据POSITION和WHENCE的值设置FILEHANDLE中的位置。

这相当于C函数lseek(),因此您应该避免将其与缓冲形式的FILEHANDLE一起使用。 这包括“FILEHANDLE”符号和打印,写入,搜索和告诉。 将它与sysread或syswrite一起使用是可以的,因为它们也忽略了缓冲。

文件中的位置由POSITION指定,使用WHENCE的值作为参考点,如下表所示。

EEK_SET -> 0
Sets the new position absolutely to POSITION bytes
within the file
SEEK_CUR -> 1
Sets the new position to the current position plus
POSITION bytes within the file
SEEK_END -> 2
Sets the new position to POSITION bytes, relative to
the end of the file

语法 (Syntax)

以下是此函数的简单语法 -

sysseek FILEHANDLE,POSITION,WHENCE

返回值 (Return Value)

此函数在失败时返回undef,位置0作为字符串0返回,但是成功时返回true和Integer,新位置(以字节为单位)。

↑回到顶部↑
WIKI教程 @2018