Apps Components Interfaces All Files Source Tree | source: tos.lib.FS.FileWrite.nc |
File reading interface, supports appending writes.
Commands |
Events |
append
completes
Parameters: |
maxSize - New reserved size (>= requested size) result - FS_OK: space was successfully reserved |
Returns: | Ignored |
Parameters: |
result - FS_OK: sync was successful |
Returns: | Ignored |
Commands - Details |
Parameters: |
filename - Name of file to open. Must not be stack allocated. flags: - open options, an or (|) of FS_Fxxx constants. truncate - TRUE if file should be truncated if it exists |
Returns: |
SUCCESS: attempt proceeds, opened will be signaledFAIL: filesystem is busy, another file is already open for writing, filename is "" |
Parameters: |
buffer - Data to write n - Number of bytes to write |
Returns: |
SUCCESS: attempt proceeds, appended will be signaledFAIL: no file was open for writing, or a close/append/reserve/sync is in progress |
newSize
bytes long. append
s that do not make the file take
more than newSize
bytes will not fail with FS_ERROR_NOSPACE.
Note: you can find the reserved size of a file by requesting a reserve
with a newSize of 0. The reserved
event will indicate the
space currently reserved.
Parameters: |
newSize - Size file is expected to grow to |
Returns: |
SUCCESS: attempt proceeds, reserved will be signaledFAIL: no file was open for writing, or a close/append/reserve/sync is in progress |
Returns: |
SUCCESS: attempt proceeds, synced will be signaledFAIL: no file was open for writing, or a close/append/reserve/sync is in progress |
Events - Details |
Parameters: |
result - FS_OK: file was closed without problems. All data has been comitted to
stable storage. |
Returns: | Ignored |
append
completes
Parameters: |
buffer - Buffer that was passed to nWritten - Number of bytes actually written but result will still be FS_OK) result - FS_OK: write was successful
FS_ERROR_xxx: write failure cause. Some bytes may have been written
(as reported by the value of |
Returns: | Ignored |