Difference between revisions of "Extensions.File.WriteBytes"

From emotive
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE:OTX '''WriteBytes'''}}Category:File == Classification == {{ClassificationActivity | WriteBytes | UPDATING... | Action | Extensions.File|OTX File exten...")
 
Line 1: Line 1:
 
{{DISPLAYTITLE:OTX '''WriteBytes'''}}[[Category:File]]
 
{{DISPLAYTITLE:OTX '''WriteBytes'''}}[[Category:File]]
 
== Classification ==
 
== Classification ==
{{ClassificationActivity | WriteBytes | UPDATING... | [[Action]] | [[Extensions.File|OTX File extension]] | UPDATING... | UPDATING... | UPDATING... }}
+
{{ClassificationActivity | WriteBytes| Appends the specified bytes to the '''filehandle''' | [[Action]] | [[Extensions.File|OTX File extension]] | [[Extensions.File#Actions|File related Actions]]| [[Extensions.File.FileAccessException|FileAccessException]] <br/> [[Extensions.File.FileFormatException|FileFormatException]] <br/> [[Extensions.File.FileLockException|FileLockException]]| -|}}
  
 
== OTL Syntax ==
 
== OTL Syntax ==
UPDATING...<!--
 
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
DiagCom.CloseComChannel(ComChannelVariable);
+
File.WriteBytes(FileWriteHandleTerm, ByteFieldTerm);
 
</syntaxhighlight>
 
</syntaxhighlight>
-->
 
  
 
== Description ==
 
== Description ==
UPDATING...<!--
+
The '''WriteBytes''' activity appends the specified bytes to the filehandle.
OTX CloseComChannel activity is used for the [[Diagnosis Runtime System]] to announce that an open communication channel that all relevant resources can be released and closed.
+
The first read or write activity on a file handle defines if an access shall be realized by line, bytes or file. Mixed access will lead to a [[Extensions.File.FileFormatException|FileFormatException]].
{{ComChannelMemoryUsageNote}}
 
{{Important|Please note that the use of a shared '''ComChannel''' can bring the OTX runtime system in an undefined state and that is this case is not validated at design time!}}
 
-->
 
  
 
== Properties ==
 
== Properties ==
UPDATING...<!--
 
 
{| {{TableHeader}}
 
{| {{TableHeader}}
 
{{TableRowPropertiesHeader}}
 
{{TableRowPropertiesHeader}}
{{TableRowPropertie1| ComChannel | [[Extensions.DiagCom.ComChannel|ComChannel]] | [[Variable]] | - | [1] | Communication Channel (Control unit).}}
+
{{TableRowPropertie1| handle| [[Extensions.File.FileWriteHandle|FileWriteHandle]] | [[Term]] | - | [1..1] | The handle for the file that the related file object encapsulates.}}
 +
{{TableRowPropertie2| value| [[Core.DataTypes.ComplexDataType.ByteField|ByteField]] | [[Term]] | - | [1..1] | The ByteField to write to the file.}}
 
|}
 
|}
-->
 
  
 
== OTL Examples ==
 
== OTL Examples ==
UPDATING...<!--
 
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
DiagCom.ComChannel myComCannel;
+
File.FileWriteHandle FileWriteHandle1;
  
myComCannel = DiagCom.GetComChannel("DiagnosticsCan_ECU_1", null, false);
+
/// Flow
  
// Code example using the variable myComChannel
+
FileWriteHandle1 = File.OpenFileForWrite("file:///D:/abc/abc.txt", false, @Encoding:UTF-8);
// ...
+
File.WriteBytes(FileWriteHandle1, &48656C6C6F);
DiagCom.CloseComChannel(myComCannel);</syntaxhighlight>
 
 
</syntaxhighlight>
 
</syntaxhighlight>
-->
 
  
 
== See also ==
 
== See also ==
UPDATING...
+
[[Extensions.File.CloseFile|CloseFile]] <br/>
 +
[[Extensions.File.DeleteDirectory|DeleteDirectory]]<br/>
 +
[[Extensions.File.DeleteFile|DeleteFile]]<br/>
 +
[[Extensions.File.SaveFile|SaveFile]]<br/>
 +
<!--[[Extensions.File.WriteBytes|WriteBytes]]<br/>-->
 +
[[Extensions.File.WriteFile|WriteFile]]<br/>
 +
[[Extensions.File.WriteLine|WriteLine]]

Revision as of 04:32, 27 September 2018

Classification

Name WriteBytes
Short Description Appends the specified bytes to the filehandle
Class Action
Extension OTX File extension
Group File related Actions
Exceptions FileAccessException
FileFormatException
FileLockException
Checker Rules -
Standard Compliant Yes

OTL Syntax

File.WriteBytes(FileWriteHandleTerm, ByteFieldTerm);

Description

The WriteBytes activity appends the specified bytes to the filehandle. The first read or write activity on a file handle defines if an access shall be realized by line, bytes or file. Mixed access will lead to a FileFormatException.

Properties

Name Data Type Class Default Cardinality Description
handle FileWriteHandle Term - [1..1] The handle for the file that the related file object encapsulates.
value ByteField Term - [1..1] The ByteField to write to the file.

OTL Examples

File.FileWriteHandle FileWriteHandle1;

/// Flow

FileWriteHandle1 = File.OpenFileForWrite("file:///D:/abc/abc.txt", false, @Encoding:UTF-8);
File.WriteBytes(FileWriteHandle1, &48656C6C6F);

See also

CloseFile
DeleteDirectory
DeleteFile
SaveFile
WriteFile
WriteLine