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

 

constructor

 

constructor(aPath: not nullable String)

 

File(String! aPath)

 

init(_ aPath: String)

 

File(String! aPath)

Parameters:

  • aPath:

Copy (not nullable File, not nullable File): not nullable File

 

class method Copy(FileName: not nullable File; NewPathAndName: not nullable File): not nullable File

 

static File! Copy(File! FileName, File! NewPathAndName)

 

static func Copy(_ FileName: File, _ NewPathAndName: File) -> File

 

static File! Copy(File! FileName, File! NewPathAndName)

Parameters:

  • FileName:
  • NewPathAndName:

Copy (not nullable File): not nullable File  mapped

 

method Copy(NewPathAndName: not nullable File): not nullable File

 

File! Copy(File! NewPathAndName)

 

func Copy(_ NewPathAndName: File) -> File

 

File! Copy(File! NewPathAndName)

Parameters:

  • NewPathAndName:

Copy (not nullable Folder, not nullable String): not nullable File  mapped

 

method Copy(Destination: not nullable Folder; NewName: not nullable String): not nullable File

 

File! Copy(Folder! Destination, String! NewName)

 

func Copy(_ Destination: Folder, _ NewName: String) -> File

 

File! Copy(Folder! Destination, String! NewName)

Parameters:

  • Destination:
  • NewName:

DateCreated

 

property DateCreated: DateTime read;

 

DateTime DateCreated { get; }

 

var DateCreated: DateTime { get{} }

 

DateTime DateCreated { __get; }

DateModified

 

property DateModified: DateTime read;

 

DateTime DateModified { get; }

 

var DateModified: DateTime { get{} }

 

DateTime DateModified { __get; }

Delete  mapped

 

method Delete

 

void Delete()

 

func Delete()

 

void Delete()

Extension

 

property Extension: String read;

 

String Extension { get; }

 

var Extension: String { get{} }

 

String Extension { __get; }

FullPath

 

property FullPath: String read;

 

String FullPath { get; }

 

var FullPath: String { get{} }

 

String FullPath { __get; }

Move (not nullable File, not nullable File): not nullable File

 

class method Move(FileName: not nullable File; NewPathAndName: not nullable File): not nullable File

 

static File! Move(File! FileName, File! NewPathAndName)

 

static func Move(_ FileName: File, _ NewPathAndName: File) -> File

 

static File! Move(File! FileName, File! NewPathAndName)

Parameters:

  • FileName:
  • NewPathAndName:

Move (not nullable File): not nullable File  mapped

 

method Move(NewPathAndName: not nullable File): not nullable File

 

File! Move(File! NewPathAndName)

 

func Move(_ NewPathAndName: File) -> File

 

File! Move(File! NewPathAndName)

Parameters:

  • NewPathAndName:

Move (not nullable Folder, not nullable String): not nullable File  mapped

 

method Move(DestinationFolder: not nullable Folder; NewName: not nullable String): not nullable File

 

File! Move(Folder! DestinationFolder, String! NewName)

 

func Move(_ DestinationFolder: Folder, _ NewName: String) -> File

 

File! Move(Folder! DestinationFolder, String! NewName)

Parameters:

  • DestinationFolder:
  • NewName:

Name

 

property Name: String read;

 

String Name { get; }

 

var Name: String { get{} }

 

String Name { __get; }

Open  mapped

 

method Open(Mode: FileOpenMode): not nullable FileHandle

 

FileHandle! Open(FileOpenMode Mode)

 

func Open(_ Mode: FileOpenMode) -> FileHandle

 

FileHandle! Open(FileOpenMode Mode)

Parameters:

  • Mode:

ReadBinary  mapped

 

method ReadBinary: Binary

 

Binary ReadBinary()

 

func ReadBinary() -> Binary

 

Binary ReadBinary()

ReadBytes  mapped

 

method ReadBytes: array of Byte

 

Byte[] ReadBytes()

 

func ReadBytes() -> Byte...

 

Byte[] ReadBytes()

ReadText  mapped

 

method ReadText(Encoding: Encoding): String

 

String ReadText(Encoding Encoding)

 

func ReadText(_ Encoding: Encoding) -> String

 

String ReadText(Encoding Encoding)

Parameters:

  • Encoding:

Rename (not nullable File, not nullable String): not nullable File

 

class method Rename(FileName: not nullable File; NewName: not nullable String): not nullable File

 

static File! Rename(File! FileName, String! NewName)

 

static func Rename(_ FileName: File, _ NewName: String) -> File

 

static File! Rename(File! FileName, String! NewName)

Parameters:

  • FileName:
  • NewName:

Rename (not nullable String): not nullable File  mapped

 

method Rename(NewName: not nullable String): not nullable File

 

File! Rename(String! NewName)

 

func Rename(_ NewName: String) -> File

 

File! Rename(String! NewName)

Parameters:

  • NewName:

 

DateCreated

 

property DateCreated: DateTime read;

 

DateTime DateCreated { get; }

 

var DateCreated: DateTime { get{} }

 

DateTime DateCreated { __get; }

DateModified

 

property DateModified: DateTime read;

 

DateTime DateModified { get; }

 

var DateModified: DateTime { get{} }

 

DateTime DateModified { __get; }

Extension

 

property Extension: String read;

 

String Extension { get; }

 

var Extension: String { get{} }

 

String Extension { __get; }

FullPath

 

property FullPath: String read;

 

String FullPath { get; }

 

var FullPath: String { get{} }

 

String FullPath { __get; }

Name

 

property Name: String read;

 

String Name { get; }

 

var Name: String { get{} }

 

String Name { __get; }

 

Copy (not nullable File, not nullable File): not nullable File

 

class method Copy(FileName: not nullable File; NewPathAndName: not nullable File): not nullable File

 

static File! Copy(File! FileName, File! NewPathAndName)

 

static func Copy(_ FileName: File, _ NewPathAndName: File) -> File

 

static File! Copy(File! FileName, File! NewPathAndName)

Parameters:

  • FileName:
  • NewPathAndName:

Move (not nullable File, not nullable File): not nullable File

 

class method Move(FileName: not nullable File; NewPathAndName: not nullable File): not nullable File

 

static File! Move(File! FileName, File! NewPathAndName)

 

static func Move(_ FileName: File, _ NewPathAndName: File) -> File

 

static File! Move(File! FileName, File! NewPathAndName)

Parameters:

  • FileName:
  • NewPathAndName:

Rename (not nullable File, not nullable String): not nullable File

 

class method Rename(FileName: not nullable File; NewName: not nullable String): not nullable File

 

static File! Rename(File! FileName, String! NewName)

 

static func Rename(_ FileName: File, _ NewName: String) -> File

 

static File! Rename(File! FileName, String! NewName)

Parameters:

  • FileName:
  • NewName:

 

constructor

 

constructor(aPath: not nullable String)

 

File(String! aPath)

 

init(_ aPath: String)

 

File(String! aPath)

Parameters:

  • aPath:

Copy (not nullable File): not nullable File  mapped

 

method Copy(NewPathAndName: not nullable File): not nullable File

 

File! Copy(File! NewPathAndName)

 

func Copy(_ NewPathAndName: File) -> File

 

File! Copy(File! NewPathAndName)

Parameters:

  • NewPathAndName:

Copy (not nullable Folder, not nullable String): not nullable File  mapped

 

method Copy(Destination: not nullable Folder; NewName: not nullable String): not nullable File

 

File! Copy(Folder! Destination, String! NewName)

 

func Copy(_ Destination: Folder, _ NewName: String) -> File

 

File! Copy(Folder! Destination, String! NewName)

Parameters:

  • Destination:
  • NewName:

Delete  mapped

 

method Delete

 

void Delete()

 

func Delete()

 

void Delete()

Move (not nullable File): not nullable File  mapped

 

method Move(NewPathAndName: not nullable File): not nullable File

 

File! Move(File! NewPathAndName)

 

func Move(_ NewPathAndName: File) -> File

 

File! Move(File! NewPathAndName)

Parameters:

  • NewPathAndName:

Move (not nullable Folder, not nullable String): not nullable File  mapped

 

method Move(DestinationFolder: not nullable Folder; NewName: not nullable String): not nullable File

 

File! Move(Folder! DestinationFolder, String! NewName)

 

func Move(_ DestinationFolder: Folder, _ NewName: String) -> File

 

File! Move(Folder! DestinationFolder, String! NewName)

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)

Parameters:

  • Mode:

ReadBinary  mapped

 

method ReadBinary: Binary

 

Binary ReadBinary()

 

func ReadBinary() -> Binary

 

Binary ReadBinary()

ReadBytes  mapped

 

method ReadBytes: array of Byte

 

Byte[] ReadBytes()

 

func ReadBytes() -> Byte...

 

Byte[] ReadBytes()

ReadText  mapped

 

method ReadText(Encoding: Encoding): String

 

String ReadText(Encoding Encoding)

 

func ReadText(_ Encoding: Encoding) -> String

 

String ReadText(Encoding Encoding)

Parameters:

  • Encoding:

Rename (not nullable String): not nullable File  mapped

 

method Rename(NewName: not nullable String): not nullable File

 

File! Rename(String! NewName)

 

func Rename(_ NewName: String) -> File

 

File! Rename(String! NewName)

Parameters:

  • NewName: