Difference between revisions of "Extensions.File.OpenFileForRead"
Jump to navigation
Jump to search
(Created page with "{{DISPLAYTITLE:OTX '''OpenFileForRead'''}}Category:File == Classification == {{ClassificationActivity | OpenFileForRead | UPDATING... | Term | Extensions.File|OTX Fi...") |
|||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:OTX '''OpenFileForRead'''}}[[Category:File]] | {{DISPLAYTITLE:OTX '''OpenFileForRead'''}}[[Category:File]] | ||
== Classification == | == Classification == | ||
− | {{ClassificationActivity | OpenFileForRead | | + | {{ClassificationActivity | OpenFileForRead| Opens a File and returns a file handle to this file | [[Term]] | [[Extensions.File|OTX File extension]] | [[Extensions.File#Terms|File related Terms]]| [[Extensions.File.FileLockException|FileLockException]] <br/>[[Extensions.File.FileNotFoundException|FileNotFoundException]] <br/> [[Extensions.File.FileOpenException|FileOpenException]]| - |}} |
== OTL Syntax == | == OTL Syntax == | ||
− | |||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | + | FileReadHandleTerm = File.OpenFileForRead(StringTerm, EncodingTerm); | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
== Description == | == Description == | ||
− | + | The '''OpenFileForRead''' activity opens a File on the specified path with read access and returns a file handle to this file. If a file is opened for reading it shall be automatically locked against writing. Simultaneous reading of the same file is possible. | |
− | + | ||
− | + | {{TermReturnValue| [[Extensions.File.FileReadHandle|FileReadHandle]] | Returns a file handle for the file in the specified path.}} | |
− | {{ | ||
− | |||
== Properties == | == Properties == | ||
− | |||
{| {{TableHeader}} | {| {{TableHeader}} | ||
{{TableRowPropertiesHeader}} | {{TableRowPropertiesHeader}} | ||
− | {{TableRowPropertie1| | + | {{TableRowPropertie1| encoding| [[Extensions.StringUtil.Encoding|Encoding]] | [[Term]] | - | [0..1] |This represents the encoding to be used. The set of standard encodings which shall be supported by any runtime system is given by the Encoding enumeration in [[Extensions.StringUtil|StringUtil]] extension. If the encoding is not specified, it assumes that Strings will be encoded using UTF-8. The encodings HEX, BIN, OCT are not allowed.}} |
+ | {{TableRowPropertie2| path| [[Core.DataTypes.SimpleDataType.String|String]] | [[Term]] | - | [1..1] |The file to open. The path parameter is permitted to specify relative or absolute path information.}} | ||
|} | |} | ||
− | |||
== OTL Examples == | == OTL Examples == | ||
− | |||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | + | File.FileReadHandle FileReadHandle1; | |
− | + | /// Flow | |
− | // | + | FileReadHandle1 = File.OpenFileForRead("file:///D:/abc.txt", @Encoding:UTF-8); |
− | // . | ||
− | |||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
== See also == | == See also == | ||
− | + | [[Extensions.File.CreateTempDirectory|CreateTempDirectory]]<br/> | |
+ | [[Extensions.File.GetFilePath|GetFilePath]]<br/> | ||
+ | [[Extensions.File.GetFilesFromDirectory|GetFilesFromDirectory]]<br/> | ||
+ | [[Extensions.File.GetFileSize|GetFileSize]]<br/> | ||
+ | [[Extensions.File.IsDirectory|IsDirectory]]<br/> | ||
+ | [[Extensions.File.IsEndOfFileReached|IsEndOfFileReached]]<br/> | ||
+ | [[Extensions.File.IsFile|IsFile]]<br/> | ||
+ | <!--[[Extensions.File.OpenFileForRead|OpenFileForRead]]<br/>--> | ||
+ | [[Extensions.File.OpenFileForWrite|OpenFileForWrite]]<br/> | ||
+ | [[Extensions.File.ReadBytes|ReadBytes]]<br/> | ||
+ | [[Extensions.File.ReadFile|ReadFile]]<br/> | ||
+ | [[Extensions.File.ReadLine|ReadLine]] |
Revision as of 09:33, 27 September 2018
Contents
Classification
Name | OpenFileForRead |
Short Description | Opens a File and returns a file handle to this file |
Class | Term |
Extension | OTX File extension |
Group | File related Terms |
Exceptions | FileLockException FileNotFoundException FileOpenException |
Checker Rules | - |
Standard Compliant | Yes |
OTL Syntax
FileReadHandleTerm = File.OpenFileForRead(StringTerm, EncodingTerm);
Description
The OpenFileForRead activity opens a File on the specified path with read access and returns a file handle to this file. If a file is opened for reading it shall be automatically locked against writing. Simultaneous reading of the same file is possible.
Return Value
The Term returns the value, see table below.
![]()
In OTX, Terms are categorized according to its return data type!
Data Type | Description |
FileReadHandle | Returns a file handle for the file in the specified path. |
Properties
Name | Data Type | Class | Default | Cardinality | Description |
encoding | Encoding | Term | - | [0..1] | This represents the encoding to be used. The set of standard encodings which shall be supported by any runtime system is given by the Encoding enumeration in StringUtil extension. If the encoding is not specified, it assumes that Strings will be encoded using UTF-8. The encodings HEX, BIN, OCT are not allowed. |
path | String | Term | - | [1..1] | The file to open. The path parameter is permitted to specify relative or absolute path information. |
OTL Examples
File.FileReadHandle FileReadHandle1;
/// Flow
FileReadHandle1 = File.OpenFileForRead("file:///D:/abc.txt", @Encoding:UTF-8);
See also
CreateTempDirectory
GetFilePath
GetFilesFromDirectory
GetFileSize
IsDirectory
IsEndOfFileReached
IsFile
OpenFileForWrite
ReadBytes
ReadFile
ReadLine