Table of Contents

Class PolarFileInfo

Namespace
PolarStudioGlobals
Assembly
PolarStudioGlobals.dll

This class returns info about one item in a PolarFileInfos collection and provides some basic manipulation methods.

public class PolarFileInfo
Inheritance
PolarFileInfo
Inherited Members
Extension Methods

Constructors

PolarFileInfo(string)

Constructor to create a single PolarFileInfo for a specific path.

public PolarFileInfo(string pPath)

Parameters

pPath string

Fields

IsDirectory

Returns True if the item is a folder (directory).

public bool IsDirectory

Field Value

bool

Properties

Attributes

Returns the attributes of the file/folder.

public FileAttributes Attributes { get; }

Property Value

FileAttributes

DirectoryInfo

Returns the underlying DirectoryInfo for a directory (folder).

public DirectoryInfo DirectoryInfo { get; }

Property Value

DirectoryInfo

FileDateTime

Returns the date/time of the file/folder (for files last modified, for folders created).

public DateTime FileDateTime { get; }

Property Value

DateTime

FileInfo

Returns the underlying FileInfo for a file.

public FileInfo FileInfo { get; }

Property Value

FileInfo

FileName

Returns the file/folder name.

public string FileName { get; }

Property Value

string

FilePath

Returns the containing path (excluding the file/folder name)

public string FilePath { get; }

Property Value

string

FileSize

Returns the size of the file. (0 for folders).

public long FileSize { get; }

Property Value

long

FullPath

Returns the full path (including the file/folder name)

public string FullPath { get; }

Property Value

string

Methods

Copy(string)

Copies the file to a new location. Does not work on folders.

public bool Copy(string pNewFileName)

Parameters

pNewFileName string

The new file name (location).

Returns

bool

True if successful, False otherwise (does not throw exceptions).

DeleteFile(bool)

Deletes a file or folder.

public bool DeleteFile(bool pRecursive = false)

Parameters

pRecursive bool

This parameter can be passed as True to recursively delete a folder and all of its sub folders and contents.

Returns

bool

True if successful, False otherwise (does not throw exceptions).

GetSelectionInfo()

Gets a selection from a folder (one or more files) for more complex operations.

public PolarFileInfo_Selection GetSelectionInfo()

Returns

PolarFileInfo_Selection

A PolarFileInfo_Selection object with the selected files.

Rename(string)

Renames (moves) a file or folder.

public bool Rename(string pNewFileName)

Parameters

pNewFileName string

The new name/location of the file or folder.

Returns

bool

True if successful, False otherwise (does not throw exceptions).