Folder

Overview

Represents a folder. Provides information about the folders and its content, and ways to manipulate them.

Use case

You can use Folder class to work with individual folder:

var Folders: array of Folder := Folder.UserLocal.GetFolders;

for item in Folders do begin
  writeLn("Folder: " + item.Name);
  writeLn("Files:");
  try
    var Files := item.GetFiles;
    for file in Files do
      writeLn("  " + file.Name);
  except
    writeLn("Unable to get files from "+item.Name);
  end;
end;

Location

 

constructor

 

constructor(aPath: not nullable String)

 

Folder(String! aPath)

 

init(_ aPath: String)

 

Folder(String aPath)

 

Sub New(aPath As String)

Parameters:

  • aPath:

Create (Folder, Boolean): Folder

 

class method Create(FolderName: Folder; FailIfExists: Boolean): Folder

 

static Folder Create(Folder FolderName, Boolean FailIfExists)

 

static func Create(_ FolderName: Folder, _ FailIfExists: Boolean) -> Folder

 

static Folder Create(Folder FolderName, Boolean FailIfExists)

 

Shared Function Create(FolderName As Folder, FailIfExists As Boolean) As Folder

Parameters:

  • FolderName:
  • FailIfExists:

Create (Boolean)  mapped

 

method Create(FailIfExists: Boolean)

 

void Create(Boolean FailIfExists)

 

func Create(_ FailIfExists: Boolean)

 

void Create(Boolean FailIfExists)

 

Sub Create(FailIfExists As Boolean)

Parameters:

  • FailIfExists:

CreateFile  mapped

 

method CreateFile(FileName: String; FailIfExists: Boolean): File

 

File CreateFile(String FileName, Boolean FailIfExists)

 

func CreateFile(_ FileName: String, _ FailIfExists: Boolean) -> File

 

File CreateFile(String FileName, Boolean FailIfExists)

 

Function CreateFile(FileName As String, FailIfExists As Boolean) As File

Parameters:

  • FileName:
  • FailIfExists:

CreateSubfolder  mapped

 

method CreateSubfolder(SubfolderName: String; FailIfExists: Boolean): Folder

 

Folder CreateSubfolder(String SubfolderName, Boolean FailIfExists)

 

func CreateSubfolder(_ SubfolderName: String, _ FailIfExists: Boolean) -> Folder

 

Folder CreateSubfolder(String SubfolderName, Boolean FailIfExists)

 

Function CreateSubfolder(SubfolderName As String, FailIfExists As Boolean) As Folder

Parameters:

  • SubfolderName:
  • FailIfExists:

Delete (Folder)

 

class method Delete(FolderName: Folder)

 

static void Delete(Folder FolderName)

 

static func Delete(_ FolderName: Folder)

 

static void Delete(Folder FolderName)

 

Shared Sub Delete(FolderName As Folder)

Parameters:

  • FolderName:

Delete  mapped

 

method Delete

 

void Delete()

 

func Delete()

 

void Delete()

 

Sub Delete()

Exists (Folder): Boolean

 

class method Exists(FolderName: Folder): Boolean

 

static Boolean Exists(Folder FolderName)

 

static func Exists(_ FolderName: Folder) -> Boolean

 

static Boolean Exists(Folder FolderName)

 

Shared Function Exists(FolderName As Folder) As Boolean

Parameters:

  • FolderName:

Exists  mapped

 

method Exists: Boolean

 

Boolean Exists()

 

func Exists() -> Boolean

 

Boolean Exists()

 

Function Exists() As Boolean

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

GetFile  mapped

 

method GetFile(FileName: String): File

 

File GetFile(String FileName)

 

func GetFile(_ FileName: String) -> File

 

File GetFile(String FileName)

 

Function GetFile(FileName As String) As File

Parameters:

  • FileName:

GetFiles (Folder, Boolean): not nullable List<File>

 

class method GetFiles(FolderName: Folder; aRecursive: Boolean): not nullable List<File>

 

static List<File>! GetFiles(Folder FolderName, Boolean aRecursive)

 

static func GetFiles(_ FolderName: Folder, _ aRecursive: Boolean) -> List<File>

 

static List<File> GetFiles(Folder FolderName, Boolean aRecursive)

 

Shared Function GetFiles(FolderName As Folder, aRecursive As Boolean) As List<File>

Parameters:

  • FolderName:
  • aRecursive:

GetFiles  mapped

 

method GetFiles: not nullable List<File>

 

List<File>! GetFiles()

 

func GetFiles() -> List<File>

 

List<File> GetFiles()

 

Function GetFiles() As List<File>

GetFiles (Boolean): not nullable List<File>  mapped

 

method GetFiles(aRecursive: Boolean): not nullable List<File>

 

List<File>! GetFiles(Boolean aRecursive)

 

func GetFiles(_ aRecursive: Boolean) -> List<File>

 

List<File> GetFiles(Boolean aRecursive)

 

Function GetFiles(aRecursive As Boolean) As List<File>

Parameters:

  • aRecursive:

GetSubfolders (Folder): not nullable List<Folder>

 

class method GetSubfolders(FolderName: Folder): not nullable List<Folder>

 

static List<Folder>! GetSubfolders(Folder FolderName)

 

static func GetSubfolders(_ FolderName: Folder) -> List<Folder>

 

static List<Folder> GetSubfolders(Folder FolderName)

 

Shared Function GetSubfolders(FolderName As Folder) As List<Folder>

Parameters:

  • FolderName:

GetSubfolders  mapped

 

method GetSubfolders: not nullable List<Folder>

 

List<Folder>! GetSubfolders()

 

func GetSubfolders() -> List<Folder>

 

List<Folder> GetSubfolders()

 

Function GetSubfolders() As List<Folder>

Name

 

property Name: String read;

 

String Name { get; }

 

var Name: String { get{} }

 

String Name { __get; }

 

ReadOnly Property Name() As String

Rename  mapped

 

method Rename(NewName: String): Folder

 

Folder Rename(String NewName)

 

func Rename(_ NewName: String) -> Folder

 

Folder Rename(String NewName)

 

Function Rename(NewName As String) As Folder

Parameters:

  • NewName:

Separator

Gets a char that is used as directory separator.

 

class property Separator: Char read;

 

class Char Separator { get; }

 

static var Separator: Char { get{} }

 

class Char Separator { __get; }

 

Shared ReadOnly Property Separator() As Char

UserHomeFolder

 

class method UserHomeFolder: Folder

 

static Folder UserHomeFolder()

 

static func UserHomeFolder() -> Folder

 

static Folder UserHomeFolder()

 

Shared Function UserHomeFolder() As Folder

 

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

 

property Name: String read;

 

String Name { get; }

 

var Name: String { get{} }

 

String Name { __get; }

 

ReadOnly Property Name() As String

Separator

Gets a char that is used as directory separator.

 

class property Separator: Char read;

 

class Char Separator { get; }

 

static var Separator: Char { get{} }

 

class Char Separator { __get; }

 

Shared ReadOnly Property Separator() As Char

 

Create (Folder, Boolean): Folder

 

class method Create(FolderName: Folder; FailIfExists: Boolean): Folder

 

static Folder Create(Folder FolderName, Boolean FailIfExists)

 

static func Create(_ FolderName: Folder, _ FailIfExists: Boolean) -> Folder

 

static Folder Create(Folder FolderName, Boolean FailIfExists)

 

Shared Function Create(FolderName As Folder, FailIfExists As Boolean) As Folder

Parameters:

  • FolderName:
  • FailIfExists:

Delete (Folder)

 

class method Delete(FolderName: Folder)

 

static void Delete(Folder FolderName)

 

static func Delete(_ FolderName: Folder)

 

static void Delete(Folder FolderName)

 

Shared Sub Delete(FolderName As Folder)

Parameters:

  • FolderName:

Exists (Folder): Boolean

 

class method Exists(FolderName: Folder): Boolean

 

static Boolean Exists(Folder FolderName)

 

static func Exists(_ FolderName: Folder) -> Boolean

 

static Boolean Exists(Folder FolderName)

 

Shared Function Exists(FolderName As Folder) As Boolean

Parameters:

  • FolderName:

GetFiles (Folder, Boolean): not nullable List<File>

 

class method GetFiles(FolderName: Folder; aRecursive: Boolean): not nullable List<File>

 

static List<File>! GetFiles(Folder FolderName, Boolean aRecursive)

 

static func GetFiles(_ FolderName: Folder, _ aRecursive: Boolean) -> List<File>

 

static List<File> GetFiles(Folder FolderName, Boolean aRecursive)

 

Shared Function GetFiles(FolderName As Folder, aRecursive As Boolean) As List<File>

Parameters:

  • FolderName:
  • aRecursive:

GetSubfolders (Folder): not nullable List<Folder>

 

class method GetSubfolders(FolderName: Folder): not nullable List<Folder>

 

static List<Folder>! GetSubfolders(Folder FolderName)

 

static func GetSubfolders(_ FolderName: Folder) -> List<Folder>

 

static List<Folder> GetSubfolders(Folder FolderName)

 

Shared Function GetSubfolders(FolderName As Folder) As List<Folder>

Parameters:

  • FolderName:

UserHomeFolder

 

class method UserHomeFolder: Folder

 

static Folder UserHomeFolder()

 

static func UserHomeFolder() -> Folder

 

static Folder UserHomeFolder()

 

Shared Function UserHomeFolder() As Folder

 

constructor

 

constructor(aPath: not nullable String)

 

Folder(String! aPath)

 

init(_ aPath: String)

 

Folder(String aPath)

 

Sub New(aPath As String)

Parameters:

  • aPath:

Create (Boolean)  mapped

 

method Create(FailIfExists: Boolean)

 

void Create(Boolean FailIfExists)

 

func Create(_ FailIfExists: Boolean)

 

void Create(Boolean FailIfExists)

 

Sub Create(FailIfExists As Boolean)

Parameters:

  • FailIfExists:

CreateFile  mapped

 

method CreateFile(FileName: String; FailIfExists: Boolean): File

 

File CreateFile(String FileName, Boolean FailIfExists)

 

func CreateFile(_ FileName: String, _ FailIfExists: Boolean) -> File

 

File CreateFile(String FileName, Boolean FailIfExists)

 

Function CreateFile(FileName As String, FailIfExists As Boolean) As File

Parameters:

  • FileName:
  • FailIfExists:

CreateSubfolder  mapped

 

method CreateSubfolder(SubfolderName: String; FailIfExists: Boolean): Folder

 

Folder CreateSubfolder(String SubfolderName, Boolean FailIfExists)

 

func CreateSubfolder(_ SubfolderName: String, _ FailIfExists: Boolean) -> Folder

 

Folder CreateSubfolder(String SubfolderName, Boolean FailIfExists)

 

Function CreateSubfolder(SubfolderName As String, FailIfExists As Boolean) As Folder

Parameters:

  • SubfolderName:
  • FailIfExists:

Delete  mapped

 

method Delete

 

void Delete()

 

func Delete()

 

void Delete()

 

Sub Delete()

Exists  mapped

 

method Exists: Boolean

 

Boolean Exists()

 

func Exists() -> Boolean

 

Boolean Exists()

 

Function Exists() As Boolean

GetFile  mapped

 

method GetFile(FileName: String): File

 

File GetFile(String FileName)

 

func GetFile(_ FileName: String) -> File

 

File GetFile(String FileName)

 

Function GetFile(FileName As String) As File

Parameters:

  • FileName:

GetFiles  mapped

 

method GetFiles: not nullable List<File>

 

List<File>! GetFiles()

 

func GetFiles() -> List<File>

 

List<File> GetFiles()

 

Function GetFiles() As List<File>

GetFiles (Boolean): not nullable List<File>  mapped

 

method GetFiles(aRecursive: Boolean): not nullable List<File>

 

List<File>! GetFiles(Boolean aRecursive)

 

func GetFiles(_ aRecursive: Boolean) -> List<File>

 

List<File> GetFiles(Boolean aRecursive)

 

Function GetFiles(aRecursive As Boolean) As List<File>

Parameters:

  • aRecursive:

GetSubfolders  mapped

 

method GetSubfolders: not nullable List<Folder>

 

List<Folder>! GetSubfolders()

 

func GetSubfolders() -> List<Folder>

 

List<Folder> GetSubfolders()

 

Function GetSubfolders() As List<Folder>

Rename  mapped

 

method Rename(NewName: String): Folder

 

Folder Rename(String NewName)

 

func Rename(_ NewName: String) -> Folder

 

Folder Rename(String NewName)

 

Function Rename(NewName As String) As Folder

Parameters:

  • NewName: