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
- Reference: Sugar
- Namespace: Sugar.IO
constructor
constructor(aPath: not nullable String)
Folder(String! aPath)
init(_ aPath: String)
Folder(String aPath)
Sub New(aPath As String)
Parameters:
- aPath:
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
Parameters:
- FileName:
- FailIfExists:
CreateSubfolder mapped
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()
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
Parameters:
- FileName:
Parameters:
- FolderName:
- aRecursive:
GetFiles mapped
Parameters:
- aRecursive:
Parameters:
- FolderName:
GetSubfolders mapped
Name
property Name: String read;
String Name { get; }
var Name: String { get{} }
String Name { __get; }
ReadOnly Property Name() As String
Rename mapped
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
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.
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:
Parameters:
- FolderName:
Parameters:
- FolderName:
- aRecursive:
Parameters:
- FolderName:
UserHomeFolder
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
Parameters:
- FileName:
- FailIfExists:
CreateSubfolder mapped
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
Parameters:
- FileName:
GetFiles mapped
Parameters:
- aRecursive:
GetSubfolders mapped
Rename mapped
Parameters:
- NewName: