File
Overview
Represents a file. Provides information about the file and its content, and ways to manipulate them.
Use case
You can use File to work with individual file:
var Files: array of File := Folder.UserLocal.GetFiles;
writeLn("Folder: "+Folder.UserLocal.Path);
writeLn("Files:");
for item in Files do
writeLn(item.Name);
Location
- Reference: Sugar
- Namespace: Sugar.IO
constructor
constructor(aPath: not nullable String)
File(String! aPath)
init(_ aPath: String)
File(String aPath)
Sub New(aPath As String)
Parameters:
- aPath:
Parameters:
- FileName:
- NewPathAndName:
Parameters:
- NewPathAndName:
Parameters:
- Destination:
- NewName:
DateCreated
property DateCreated: DateTime read;
DateTime DateCreated { get; }
var DateCreated: DateTime { get{} }
DateTime DateCreated { __get; }
ReadOnly Property DateCreated() As DateTime
DateModified
property DateModified: DateTime read;
DateTime DateModified { get; }
var DateModified: DateTime { get{} }
DateTime DateModified { __get; }
ReadOnly Property DateModified() As DateTime
Delete mapped
method Delete
void Delete()
func Delete()
void Delete()
Sub Delete()
Extension
property Extension: String read;
String Extension { get; }
var Extension: String { get{} }
String Extension { __get; }
ReadOnly Property Extension() As String
FullPath
property FullPath: String read;
String FullPath { get; }
var FullPath: String { get{} }
String FullPath { __get; }
ReadOnly Property FullPath() As String
Parameters:
- FileName:
- NewPathAndName:
Parameters:
- NewPathAndName:
Parameters:
- DestinationFolder:
- NewName:
Name
property Name: String read;
String Name { get; }
var Name: String { get{} }
String Name { __get; }
ReadOnly Property Name() As String
Open mapped
method Open(Mode: FileOpenMode): not nullable FileHandle
FileHandle! Open(FileOpenMode Mode)
func Open(_ Mode: FileOpenMode) -> FileHandle
FileHandle Open(FileOpenMode Mode)
Function Open(Mode As FileOpenMode) As FileHandle
Parameters:
- Mode:
ReadBinary mapped
method ReadBinary: Binary
Binary ReadBinary()
func ReadBinary() -> Binary
Binary ReadBinary()
Function ReadBinary() As Binary
ReadBytes mapped
method ReadBytes: array of Byte
Byte[] ReadBytes()
func ReadBytes() -> Byte...
Byte[] ReadBytes()
Function ReadBytes() As Byte()
ReadText mapped
Parameters:
- Encoding:
Parameters:
- FileName:
- NewName:
Parameters:
- NewName:
DateCreated
property DateCreated: DateTime read;
DateTime DateCreated { get; }
var DateCreated: DateTime { get{} }
DateTime DateCreated { __get; }
ReadOnly Property DateCreated() As DateTime
DateModified
property DateModified: DateTime read;
DateTime DateModified { get; }
var DateModified: DateTime { get{} }
DateTime DateModified { __get; }
ReadOnly Property DateModified() As DateTime
Extension
property Extension: String read;
String Extension { get; }
var Extension: String { get{} }
String Extension { __get; }
ReadOnly Property Extension() As String
FullPath
property FullPath: String read;
String FullPath { get; }
var FullPath: String { get{} }
String FullPath { __get; }
ReadOnly Property FullPath() As String
Name
Parameters:
- FileName:
- NewPathAndName:
Parameters:
- FileName:
- NewPathAndName:
Parameters:
- FileName:
- NewName:
constructor
constructor(aPath: not nullable String)
File(String! aPath)
init(_ aPath: String)
File(String aPath)
Sub New(aPath As String)
Parameters:
- aPath:
Parameters:
- NewPathAndName:
Parameters:
- Destination:
- NewName:
Delete mapped
method Delete
void Delete()
func Delete()
void Delete()
Sub Delete()
Parameters:
- NewPathAndName:
Parameters:
- DestinationFolder:
- NewName:
Open mapped
method Open(Mode: FileOpenMode): not nullable FileHandle
FileHandle! Open(FileOpenMode Mode)
func Open(_ Mode: FileOpenMode) -> FileHandle
FileHandle Open(FileOpenMode Mode)
Function Open(Mode As FileOpenMode) As FileHandle
Parameters:
- Mode:
ReadBinary mapped
method ReadBinary: Binary
Binary ReadBinary()
func ReadBinary() -> Binary
Binary ReadBinary()
Function ReadBinary() As Binary
ReadBytes mapped
method ReadBytes: array of Byte
Byte[] ReadBytes()
func ReadBytes() -> Byte...
Byte[] ReadBytes()
Function ReadBytes() As Byte()
ReadText mapped
Parameters:
- Encoding:
Parameters:
- NewName: