获取文件指针的当前位置。
返回文件指针的当前位置(以字节为单位的偏移量)。 number
tell()
”`javascript function main() { let file = os.open(“data.txt”, “r+”) Log(“Initial position:”, file.tell()) // Initial position: 0
file.write("Hello")
Log("After write position:", file.tell()) // After write position: 5
file.close()
}“` 记录文件操作过程中的位置。
返回文件指针相对于文件起始位置的字节偏移量。
{@fun/OS/File/close close}, {@fun/OS/File/puts puts}, {@fun/OS/File/printf printf}, {@fun/OS/File/flush flush}, {@fun/OS/File/tell tell}, {@fun/OS/File/seek seek}, {@fun/OS/File/eof eof}, {@fun/OS/File/read read}, {@fun/OS/File/write write}, {@fun/OS/File/getline getline}, {@fun/OS/File/toString toString}