Difference between revisions of "BINCLOSE()"
From Lianjapedia
Helen.george (Talk | contribs) |
Barrymavin (Talk | contribs) (→Example) |
||
(3 intermediate revisions by one other user not shown) | |||
Line 3: | Line 3: | ||
==Syntax== | ==Syntax== | ||
− | BINCLOSE( | + | BINCLOSE(<expN>) |
==See Also== | ==See Also== | ||
Line 13: | Line 13: | ||
==Example== | ==Example== | ||
<code lang="recital"> | <code lang="recital"> | ||
− | fd = binopen("file.obj") | + | fd = binopen("file.obj", 2) |
count = binread(fd, 4) | count = binread(fd, 4) | ||
count = bin2l(count) | count = bin2l(count) | ||
Line 22: | Line 22: | ||
</code> | </code> | ||
− | |||
− | |||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
− | [[Category: | + | [[Category:Object Storage Functions]] |
− | + | ||
[[Category:Lianja VFP Extensions]] | [[Category:Lianja VFP Extensions]] | ||
[[Category:VFP Function Extensions]] | [[Category:VFP Function Extensions]] |
Latest revision as of 20:57, 28 February 2019
Contents
Purpose
Function to close a file opened for binary file access
Syntax
BINCLOSE(<expN>)
See Also
BIN2I(), BIN2L(), BIN2W(), BINCREATE(), BINOPEN(), BINREAD(), BINSEEK(), BINWRITE(), FCLOSE(), FOPEN(), I2BIN(), L2BIN()
Description
The BINCLOSE() function is used to close a binary file which was opened with the BINCREATE() or BINOPEN() functions. Associated buffers are written to the disk as the file is closed. <expN> is the file descriptor returned when the file was opened with either the BINCREATE() or BINOPEN() functions. The binary conversion functions can be used in conjunction with all the binary file functions.
Example
fd = binopen("file.obj", 2) count = binread(fd, 4) count = bin2l(count) count = l2bin(count + 1) binseek(fd, 512, 0) binwrite(fd, count) binclose(fd)