Einzelnen Beitrag anzeigen
Alt 10.10.2012, 02:13   #80
leecher
Moderator
C_TELL

E r g e b n i s / R e s u l t

The C_TELL function gets the current position of a file pointer.

B e s c h r e i b u n g / D e s c r i p t i o n

The C_TELL function gets the current position of the file pointer associated with the file descriptor fd.

S y n t a x

Code:
res = call ('C_TELL' , fd)
P a r a m e t e r

fd - The file descriptor you obtained from C_OPEN

R e t u r n s

C_TELL returns the offset, in bytes, of the current position from the beginning of the file or -1 on error.

B e i s p i e l / E x a m p l e

Code:
attach 'FILE0'
attach 'FILE1'
fd = CALL ("C_OPEN", "FILE.TXT", "w")
b = CALL ("C_WRITE", fd, "12345", 5)
PUT CALL ("C_TELL", fd) ! Returns 5 as this is the current offset in the file
b = CALL("C_CLOSE", fd)
detach 'FILE0'
detach 'FILE1'
leecher ist offline   Mit Zitat antworten