system.filesystem - Palamecia/mint GitHub Wiki

Module

load system.filesystem

This module provides tools to manage the file system informations.

Packages

Enums

System.StandardPath

This enum represent a standrad path type that can be used to query a standard path to the file system.

Constant Value Description
Applications 8 An application location like '/usr/bin' or 'C:/Program Files'
Cache 11 A cache location like '~/.cache' or 'C:/Users/<user>/AppData/Local/Cache'
Config 16 A configuration location like '~/.config' or 'C:/Users/<user>/AppData/Loc...
Data 13 A data location like '~/???' or 'C:/Users/<user>/AppData/Roaming'
Desktop 2 A desktop location like '~/Desktop' or 'C:/Users/<user>/Desktop'
Documents 3 A document location like '~/Documents' or 'C:/Users/<user>/Documents'
Download 7 A download location like '~/Downloads' or 'C:/Users/<user>/Downloads'
Fonts 10 A font location like '/usr/share/fonts' or 'C:/Windows/Fonts'
GlobalCache 12 A global cache location like '/var/cache' or 'C:/ProgramData/???'
GlobalConfig 17 A global configuration location like '/???' or 'C:/ProgramData/???'
GlobalData 15 A global data location like '/usr/share' or 'C:/ProgramData'
Home 1 An home location like '~' or 'C:/Users/<user>'
LocalData 14 A local data location like '~/.local/share' or 'C:/Users/<user>/AppData/L...
Movies 5 A document location like '~/Movies' or 'C:/Users/<user>/Movies'
Musics 4 A music location like '~/Musics' or 'C:/Users/<user>/Musics'
Pictures 6 A picture location like '~/Pictures' or 'C:/Users/<user>/Pictures'
Root 0 The system root location like '/' or 'C:'
Temporary 9 A temporary location like '/tmp' or 'C:/Users/<user>/AppData/Local/Temp'

Classes

System.FileSystem

This class provides an interface to interact with the file system and access standard locations.

Public members

Modifiers Member Description
@ const Separator Native path separator: "/" under Unix and "" under Windows.
@ const SeparatorPattern Pattern used to search for a separator in a path.
const findStandardPath Returns the most significant existing path under a root that matches the gi...
const findStandardPaths Returns an array of each existing path under a root that matches the givent...
const getStandardPath Returns the most significant path that matches the givent type. The type ...
const getStandardPaths Returns an array of each path that matches the givent type. The type para...

Package members

Modifiers Member Description
const new Internal constructor.

Private members

Modifiers Member Description
@ g_lib Global library handle.

Constants

Descriptions

System.FS

System.FileSystem ()

Global file system instance

System.FileSystem.Separator

none

Native path separator: "/" under Unix and "" under Windows.

System.FileSystem.SeparatorPattern

none

Pattern used to search for a separator in a path.

System.FileSystem.findStandardPath

def (const self, % type, path)

Returns the most significant existing path under a root that matches the givent type. The type parameter must be a value from System.StandardPath.

System.FileSystem.findStandardPaths

def (const self, % type, path)

Returns an array of each existing path under a root that matches the givent type. The type parameter must be a value from System.StandardPath.

System.FileSystem.g_lib

lib ('libmint-system')

Global library handle.

System.FileSystem.getStandardPath

def (const self, % type)

Returns the most significant path that matches the givent type. The type parameter must be a value from System.StandardPath.

def (const self, % type, path)

Returns the most significant path with a root that matches the givent type. The type parameter must be a value from System.StandardPath.

System.FileSystem.getStandardPaths

def (const self, % type)

Returns an array of each path that matches the givent type. The type parameter must be a value from System.StandardPath.

System.FileSystem.new

none

Internal constructor.

System.StandardPath.Applications

8

An application location like '/usr/bin' or 'C:/Program Files'

System.StandardPath.Cache

11

A cache location like '~/.cache' or 'C:/Users/<user>/AppData/Local/Cache'

System.StandardPath.Config

16

A configuration location like '~/.config' or 'C:/Users/<user>/AppData/Local/???'

System.StandardPath.Data

13

A data location like '~/???' or 'C:/Users/<user>/AppData/Roaming'

System.StandardPath.Desktop

2

A desktop location like '~/Desktop' or 'C:/Users/<user>/Desktop'

System.StandardPath.Documents

3

A document location like '~/Documents' or 'C:/Users/<user>/Documents'

System.StandardPath.Download

7

A download location like '~/Downloads' or 'C:/Users/<user>/Downloads'

System.StandardPath.Fonts

10

A font location like '/usr/share/fonts' or 'C:/Windows/Fonts'

System.StandardPath.GlobalCache

12

A global cache location like '/var/cache' or 'C:/ProgramData/???'

System.StandardPath.GlobalConfig

17

A global configuration location like '/???' or 'C:/ProgramData/???'

System.StandardPath.GlobalData

15

A global data location like '/usr/share' or 'C:/ProgramData'

System.StandardPath.Home

1

An home location like '~' or 'C:/Users/<user>'

System.StandardPath.LocalData

14

A local data location like '~/.local/share' or 'C:/Users/<user>/AppData/Local'

System.StandardPath.Movies

5

A document location like '~/Movies' or 'C:/Users/<user>/Movies'

System.StandardPath.Musics

4

A music location like '~/Musics' or 'C:/Users/<user>/Musics'

System.StandardPath.Pictures

6

A picture location like '~/Pictures' or 'C:/Users/<user>/Pictures'

System.StandardPath.Root

0

The system root location like '/' or 'C:'

System.StandardPath.Temporary

9

A temporary location like '/tmp' or 'C:/Users/<user>/AppData/Local/Temp'

⚠️ **GitHub.com Fallback** ⚠️