Teledyne-lecroy SAS_SATA Protocol Suite Verification Script Engine Manuale Utente Pagina 66

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 97
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 65
66
Chapter 18: File Functions
This group of functions covers VSE capabilities to work with the external files.
18.1 OpenFile()
This function opens a read-write file for writing or appending content.
Format : OpenFile( file_path, file_creation_type = 0, file_open_type = 0 )
Parameters
file_path Full path of the file to open (for\’ use ‘\\’)
If the path is not specified, the file is in the USER folder.
file_creation_type _FC_RW_CREATE
Writes new content to the file by replacing the previous content.
Note: _FC_RW_CREATE ERASEs the file content (if any)
while it is opening.
_FC_RW_APPEND
Appends/adds new content at the end of the previous file
content without replacing the same.
file_open_type _FO_TEXT opens as a Text document (*.txt).
_FO_BINARY opens as a Binary file.
Return Values
The "handle" to the file to be used in other file functions.
Example
set file_handle = 0;
# Opens file with default options (“<path>”, 0, 0), to open as
# a text document and to overwrite its previous contents.
file_handle = OpenFile( "D:\\Log.txt" );
# Write text string to file.
WriteString(file_handle, "Some Text1" );
# Write text string to file.
WriteString( file_handle, "Some Text2" );
CloseFile( file_handle ); # Closes file.
# Opens file in Binary mode with _APPEND functionality.
file_handle = OpenFile("Sample.bin", _FC_RW_APPEND, _FO_BINARY
);
# Write text string to file.
WriteBin( file_handle, "Some Text1" );
# Write integer to file.
WriteBin( file_handle, 0x1234ABCD);
CloseFile( file_handle ); # Closes file.
Vedere la pagina 65
1 2 ... 61 62 63 64 65 66 67 68 69 70 71 ... 96 97

Commenti su questo manuale

Nessun commento