Einzelnen Beitrag anzeigen
Alt 10.10.2012, 01:41   #76
leecher
Moderator
C_WRITE

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

The C_WRITE function writes data to a file previously opened by C_OPEN.

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_WRITE function writes data to the file specified by the filedescriptor fd. The maximum number of bytes to write can be 254 characters.

S y n t a x

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

fd - The file descriptor you obtained from C_OPEN
str - The string which contains the data to write
len - The number of characters to write to the file, 254 max.

R e t u r n s

The number of bytes written or -1 on error.

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

Code:
attach 'FILE0'
fd = CALL ("C_OPEN", "FILE.TXT", "w")
PUT CALL ("C_WRITE", fd, "blabla", 6)
b = CALL("C_CLOSE", fd)
detach 'FILE0'
leecher ist offline   Mit Zitat antworten