File Services Sample: Difference between revisions
m (moved File Services Samples to File Services Sample) |
|
(No difference)
|
Revision as of 23:51, 6 June 2011
Introduction
Please read the File Transfer Services article before proceeding in order to understand the concepts.
This example presents a few basic examples of how to use the File Transfer Services API to interact with the host filesystem from test code executing on the device. These services are only available when your code is executing under the control of the STRIDE Runner, such as when you are running Test Units.
Tests Description
CopyHostToTarget
This example shows how to open a file on the host for read access and write all bytes to a local file. We use a temporary file buffer for writing, but any writable stream could be used as a destination.
WriteToHostTempFile
This example shows how to request a temporary file name on the host and write data to the file. We also demonstrate how to use the rename and remove functionality.
SeekAndTell
This example shows how to open a file and seek to a specific location.
ReadAndWriteLines
This example shows how to use the line-oriented functions - srFileGets and srFilePuts - to read and write lines of text.