Servizio ScriptForge.FileSystem

Il servizio FileSystem comprende routine per gestire i file e le cartelle. Di seguito sono riportati alcuni esempi delle funzionalità fornite da questo servizio:

note

I metodi del servizio FileSystem si basano principalmente sull'interfaccia XSimpleFileAccess di UNO.


Definizioni

La tabella sottostante elenca i principali parametri usati dalla maggior parte dei metodi del servizio FileSystem.

Parametro

Descrizione

FileName

Il nome completo del file, compreso il percorso e senza il carattere di separazione delle cartelle alla fine.

FolderName

Il nome completo della cartella, incluso il percorso. Può terminare con o senza il carattere di separazione delle cartelle.

Name

L'ultimo componente del nome della cartella (Folder Name) o del nome del file (File Name) compresa la sua estensione. Questo parametro viene sempre espresso usando il formato nativo del sistema operativo.

BaseName

L'ultimo componente del nome della cartella (Folder Name) o del nome del file (File Name) esclusa la sua estensione.

NamePattern

Qualsiasi nome di cui sopra contenente dei caratteri jolly come ultimo componente. I caratteri jolly ammessi sono:

  • "?" rappresenta un singolo carattere qualsiasi

  • "*" rappresenta nessuno, uno o più caratteri


tip

Il servizio FileSystem permette di eseguire operazioni su più file contemporaneamente. Usando modelli di nome, gli script dell'utente possono copiare, spostare o eliminare più file. Al contrario, i metodi incorporati in Basic possono gestire solamente singoli file.


Notazione dei nomi dei file

La notazione usata per esprimere i nomi dei file e delle cartelle, sia negli argomenti, sia nei valori restituiti, è definita dalla proprietà FileNaming del servizio FileSystem.

In breve, i possibili tipi di rappresentazione sono: "URL" (notazione dell'URL del file), "SYS" (notazione del sistema operativo) e "ANY" (predefinita). Per maggiori informazioni vedere la tabella seguente.

tip

Un esempio di notazione URL è file:///C:/Documents/my_file.odt. Considerate di utilizzare la notazione URL ogni qualvolta ciò sia possibile, in quanto è un'alternativa più versatile.


warning

The use of the shortcut "~" (tilde), which is common in Linux-based operating systems, is not supported to express a path to a folder and file name. Instead of using "~/Documents/my_file.odt" use the full path "/home/user/Documents/my_file.odt".


Invocare il servizio

Il seguente frammento di codice invoca il servizio FileSystem. Il metodo BuildPath è stato usato come esempio.

In Basic

      GlobalScope.BasicLibraries.LoadLibrary("ScriptForge")
      Dim FSO As Object
      Set FSO = CreateScriptService("FileSystem")
      FSO.BuildPath(...)
    
In Python

      from scriptforge import CreateScriptService
      fso = CreateScriptService("FileSystem")
      fso.BuildPath(...)
    

Proprietà

Nome

Sola lettura

Tipo

Descrizione

FileNaming

No

String

Imposta o restituisce la notazione corrente per i file e le cartelle, che sia "ANY", "URL" o "SYS":

  • "ANY": (predefinita) i metodi del servizio FileSystem accettano per gli argomenti inseriti sia la notazione URL, sia quella del sistema operativo in uso, ma restituiscono sempre stringhe in formato URL.

  • "URL": i metodi del servizio FileSystem si aspettano di ricevere gli argomenti nella notazione URL e restituiscono stringhe nel formato URL.

  • "SYS": i metodi del servizio FileSystem si aspettano la notazione del sistema operativo in uso sia per gli argomenti inseriti, sia per le stringhe che restituiscono.

Una volta impostata, la proprietà FileNaming rimane immutata fino alla fine della sessione di LibreOffice o fino a che viene reimpostata.

ConfigFolder

String

Restituisce la cartella della configurazione di LibreOffice.

ExtensionsFolder

String

Restituisce la cartella in cui sono installate le estensioni.

HomeFolder

String

Restituisce la cartella personale dell'utente.

InstallFolder

String

Restituisce la cartella in cui è installato LibreOffice.

TemplatesFolder

String

Restituisce la cartella che contiene i file dei modelli di sistema.

TemporaryFolder

String

Restituisce la cartella dei file temporanei definita nelle impostazioni dei percorsi di LibreOffice.

UserTemplatesFolder

String

Restituisce la cartella contenente i file dei modelli definiti dall'utente.


Elenco dei metodi del servizio FileSystem

BuildPath
CompareFiles
CopyFile
CopyFolder
CreateFolder
CreateTextFile
DeleteFile
DeleteFolder
FileExists

Files
FolderExists
GetBaseName
GetExtension
GetFileLen
GetFileModified
GetName
GetParentFolderName

GetTempName
HashFile
MoveFile
MoveFolder
OpenTextFile
PickFile
PickFolder
SubFolders


BuildPath

Unisce il percorso di una cartella al nome di un file e restituisce il nome del file completo usando un carattere di separazione delle cartelle valido. Il carattere di separazione delle cartelle è aggiunto solo se necessario.

Sintassi:

svc.BuildPath(foldername: str, name: str): str

Parametri:

foldername: The path with which name will be combined. The specified path does not need to be an existing folder.

name: The name of the file to be appended to foldername. This parameter uses the notation of the current operating system.

Esempio:

In Basic

      Dim FSO as Object
      Set FSO = CreateScriptService("FileSystem")
      Dim aFileName as String
      FSO.FileNaming = "URL"
      aFileName = FSO.BuildPath("file:///home/user", "sample file.odt")
      ' file:///home/user/sample%20file.odt
    
In Python

      fso = CreateScriptService("FileSystem")
      fso.FileNaming = "URL"
      aFileName = fso.BuildPath("file:///home/user", "sample file.odt")
      # file:///home/user/sample%20file.odt
    

CompareFiles

Confronta due file e restituisce True se sembrano identici.

Depending on the value of the comparecontents argument, the comparison between both files can be either based only on file attributes (such as the last modified date), or based on the file contents.

Sintassi:

svc.CompareFiles(filename1: str, filename2: str, comparecontents: bool = False): bool

Parametri:

filename1, filename2: The files to compare.

comparecontents: When True, the contents of the files are compared (default = False).

Esempio:

In Basic

      FSO.FileNaming = "SYS"
      If FSO.CompareFiles("C:\myFile1.txt", "C:\myFile2.txt", CompareContents := False) Then
          ' ...
      End If
    
In Python

      fso.FileNaming = "SYS"
      if fso.CompareFiles(r"C:\myFile1.txt", r"C:\myFile2.txt", comparecontents = False):
          # ...
    

CopyFile

Copia uno o più file da una posizione a un'altra. Restituisce True se almeno un file è stato copiato o False se si è verificato un errore.

An error will also occur if the source parameter uses wildcard characters and does not match any files.

Il metodo si interrompe immediatamente dopo aver incontrato un errore. Il metodo non ritorna al punto di partenza e non annulla le modifiche fatte prima di incontrare l'errore.

Sintassi:

svc.CopyFile(source: str, destination: str, overwrite: bool = True): bool

Parametri:

source: It can be a FileName or a NamePattern indicating one or more files to be copied.

destination: It can be either a FileName specifying where the single source file is to be copied, or a FolderName into which the multiple files from source are to be copied.

overwrite: If True (default), files may be overwritten. The method will fail if destination is readonly, regardless of the value specified in overwrite.

Esempio:

In the examples below the first line copies a single file whereas the second line copies multiple files using wildcards.

In Basic

      FSO.CopyFile("C:\Documents\my_file.odt", "C:\Temp\copied_file.odt")
      FSO.CopyFile("C:\Documents\*.*", "C:\Temp\", Overwrite := False)
    
In Python

      fso.CopyFile(r"C:\Documents\my_file.odt", r"C:\Temp\copied_file.odt")
      fso.CopyFile(r"C:\Documents\*.*", r"C:\Temp", overwrite = False)
    
note

Beware that subfolders and their contents are not copied when wildcards are used in the source argument.


CopyFolder

Copia una o più cartelle da una posizione a un'altra. Restituisce True se almeno una cartella è stata copiata o False se si è verificato un errore.

An error will also occur if the source parameter uses wildcard characters and does not match any folders.

Il metodo si interrompe immediatamente dopo aver incontrato un errore. Il metodo non ritorna al punto di partenza e non annulla le modifiche effettuate prima di incontrare l'errore.

Sintassi:

svc.CopyFolder(source: str, destination: str, overwrite: bool = True): bool

Parametri:

source: It can be a FolderName or a NamePattern indicating one or more folders to be copied.

destination: Specifies the FolderName into which the single or multiple folders defined in source are to be copied.

overwrite: If True (default), files may be overwritten. The method will fail if destination is readonly, regardless of the value specified in overwrite.

Esempio:

In the examples below all files, folders and subfolders are copied.


      ' Basic
      FSO.CopyFolder("C:\Documents\*", "C:\Temp\", Overwrite := False)
    

      # Python
      fso.CopyFolder(r"C:\Documents\*", r"C:\Temp", overwrite = False)
    

CreateFolder

Crea la cartella specificata in FolderName. Restituisce True se la cartella può essere creata correttamente.

Se la cartella specificata ha una cartella genitore che non esiste, questa viene creata.

Sintassi:

svc.CreateFolder(foldername: str): bool

Parametri:

foldername: A string representing the folder to be created. If the folder already exists, an exception will be raised.

Esempio:


      ' Basic
      FSO.CreateFolder("C:\NewFolder")
    

      # Python
      fso.CreateFolder(r"C:\NewFolder")
    

CreateTextFile

Creates a specified file and returns a TextStream service instance that can be used to write to the file.

Il metodo restituisce un oggetto Null se si verifica un errore.

Sintassi:

svc.CreateTextFile(filename: str, overwrite: bool = True, encoding: str = 'UTF-8'): svc

Parametri:

filename: The name of the file to be created.

overwrite: Boolean value that determines if filename can be overwritten (default = True).

encoding: The character set to be used. The default encoding is "UTF-8".

Esempio:

In Basic

      Dim myFile As Object
      FSO.FileNaming = "SYS"
      Set myFile = FSO.CreateTextFile("C:\Temp\ThisFile.txt", Overwrite := True)
    
In Python

      fso.FileNaming = "SYS"
      myFile = fso.CreateTextFile(r"C:\Temp\ThisFile.txt", overwrite = True)
    
note

Per saperne di più in merito ai nomi delle codifiche dei caratteri, visitate la pagina Codifiche dei caratteri IANA. Fate attenzione che LibreOffice non implementa tutte le codifiche dei caratteri esistenti.


DeleteFile

Elimina uno o più file. Restituisce True se almeno un file è stato eliminato o False se si verifica un errore.

An error will also occur if the filename parameter uses wildcard characters and does not match any files.

I file da eliminare non devono essere di sola lettura.

Il metodo si interrompe immediatamente dopo aver rilevato un errore. Il metodo non ritorna al punto di partenza e non annulla le modifiche effettuate prima della comparsa dell'errore.

Sintassi:

svc.DeleteFile(filename: str): bool

Parametri:

filename: It can be a FileName or a NamePattern indicating one or more files to be deleted.

Esempio:

In the examples below only files are deleted, subfolders are not deleted.


      ' Basic
      FSO.DeleteFile("C:\Temp\*.docx")
    

      # Python
      fso.DeleteFile(r"C:\Temp\*.docx")
    

DeleteFolder

Elimina una o più cartelle. Restituisce True se almeno una cartella è stata eliminata o False se si verifica un errore.

An error will also occur if the foldername parameter uses wildcard characters and does not match any folders.

Le cartelle da eliminare non devono essere di sola lettura.

Il metodo si interrompe immediatamente dopo aver rilevato un errore. Il metodo non ritorna al punto di partenza e non annulla le modifiche effettuate prima della comparsa dell'errore.

Sintassi:

svc.DeleteFolder(foldername: str): bool

Parametri:

foldername: It can be a FolderName or a NamePattern indicating one or more folders to be deleted.

Esempio:

In the examples below only folders and their contents are deleted. Files in the parent folder "C:\Temp" are not deleted.


      ' Basic
      FSO.DeleteFolder("C:\Temp\*")
    

      # Python
      fso.DeleteFolder(r"C:\Temp\*")
    

FileExists

Restituisce True se un determinato nome di file è valido ed esistente, altrimenti il metodo restituisce False.

If the filename parameter is actually an existing folder name, the method returns False.

Sintassi:

svc.FileExists(filename: str): bool

Parametri:

filename: A string representing the file to be tested.

Esempio:

In Basic

      FSO.FileNaming = "SYS"
      If FSO.FileExists("C:\Documents\my_file.odt") Then
          '...
      End If
    
In Python

      fso.FileNaming = "SYS"
      if fso.FileExists(r"C:\Documents\my_file.odt"):
          # ...
    

Files

Restituisce una matrice, con indice a partire da zero, dei file memorizzati in una determinata cartella. Ogni voce della matrice è una stringa che comprende l'intero percorso e il nome del file.

If the argument foldername specifies a folder that does not exist, an exception is raised.

L'elenco risultante può essere filtrato usando dei caratteri jolly.

Sintassi:

svc.Files(foldername: str, filter: str = ''): str[0..*]

Parametri:

foldername: A string representing a folder. The folder must exist. This argument must not designate a file.

filter: A string containing wildcards ("?" and "*") that will be applied to the resulting list of files (default = "").

Esempio:

In Basic

      Dim filesList As Variant, file As String
      FSO.FileNaming = "SYS"
      filesList = FSO.Files("/home/user/", "*.txt")
      For Each file In filesList
          ' ...
      Next file
    
In Python

      fso.FileNaming = "SYS"
      filesList = fso.Files("/home/user/", "*.txt")
      for file in fileList:
          # ...
    

FolderExists

Restituisce True se la cartella specificata in FolderName è valida ed esistente, altrimenti il metodo restituisce False.

If the foldername parameter is actually an existing file name, the method returns False.

Sintassi:

svc.FolderExists(foldername: str): bool

Parametri:

foldername: A string representing the folder to be tested.

Esempio:

In Basic

      FSO.FileNaming = "SYS"
      If FSO.FolderExists("C:\Documents\Thesis") Then
          '...
      End If
    
In Python

      fso.FileNaming = "SYS"
      if fso.FolderExists(r"C:\Documents\Thesis")
          # ...
    

GetBaseName

Restituisce il parametro BaseName (corrispondente all'ultimo componente) del nome di una cartella o di un file, senza estensione.

Il metodo non controlla se il file o la cartella specificata esiste.

Sintassi:

svc.GetBaseName(filename: str): str

Parametri:

filename: A string representing the file name and its path.

Esempio:

In the examples below, the first GetBaseName method call corresponds to a folder, so the function returns the last component of the path. The second call receives a file name as input, so the name of the file is returned without its extension.

In Basic

      MsgBox FSO.GetBaseName("/home/user/Documents") ' "Documents"
      MsgBox FSO.GetBaseName("/home/user/Documents/my_file.ods") ' "my_file"
    
In Python

      bas = CreateScriptService("Basic")
      bas.MsgBox(fso.GetBaseName("/home/user/Documents")) # "Documents"
      bas.MsgBox(fso.GetBaseName("/home/user/Documents/my_file.ods")) # "my_file"
    

GetExtension

Restituisce la parte relativa all'estensione dal nome di un file o di una cartella, senza il carattere del punto ".".

Il metodo non controlla l'esistenza del file o della cartella indicata.

Se questo metodo viene applicato al nome di una cartella o ad un file privo di estensione verrà restituita una stringa vuota.

Sintassi:

svc.GetExtension(filename: str): str

Parametri:

filename: A string representing the file name and its path.

Esempio:


      ' Basic
      ext = FSO.GetExtension("C:\Windows\Notepad.exe")  ' "exe"
    

      # Python
      ext = fso.GetExtension(r"C:\Windows\Notepad.exe")  # "exe"
    

GetFileLen

La funzione FileLen incorporata in Basic restituisce il numero di byte contenuti in un file come valore di tipo Long, cioè fino a 2GB.

Il metodo GetFileLen può gestire file di dimensioni molto più grandi restituendo un valore di tipo Currency.

Sintassi:

svc.GetFileLen(filename: str): num

Parametri:

filename: A string representing an existing file.

Esempio:

In Basic

      Dim fLen As Currency
      FSO.FileNaming = "SYS"
      fLen = FSO.GetFileLen("C:\pagefile.sys")
    
In Python

      fso.FileNaming = "SYS"
      fLen = fso.GetFileLen(r"C:\pagefile.sys")
    

GetFileModified

Restituisce la data dell'ultima modifica ad un determinato file.

Sintassi:

svc.GetFileModified(filename: str): datetime

Parametri:

filename: A string representing an existing file.

Esempio:

In Basic

      Dim aDate As Date
      FSO.FileNaming = "SYS"
      aDate = FSO.GetFileModified("C:\Documents\my_file.odt")
    
In Python

      fso.FileNaming = "SYS"
      aDate = FSO.GetFileModified(r"C:\Documents\my_file.odt")
    

GetName

Restituisce l'ultimo componente del nome di un file o di una cartella nel formato nativo del sistema operativo.

Il metodo non controlla se il file o la cartella specificata esiste.

Sintassi:

svc.GetName(filename: str): str

Parametri:

filename: A string representing the file name and its path.

Esempio:


      ' Basic
      a = FSO.GetName("C:\Windows\Notepad.exe")  ' Notepad.exe
    

      # Python
      a = fso.GetName(r"C:\Windows\Notepad.exe")  # Notepad.exe
    

GetParentFolderName

Restituisce una stringa contenente il nome della cartella padre di un file o di una cartella specificata.

Il metodo non controlla se il file o la cartella specificata esiste.

Sintassi:

svc.GetParentFolderName(filename: str): str

Parametri:

filename: A string with the file or folder name to be analyzed.

Esempio:


      ' Basic
      a = FSO.GetParentFolderName("C:\Windows\Notepad.exe")  ' C:\Windows\
    

      # Python
      a = fso.GetParentFolderName(r"C:\Windows\Notepad.exe")  # C:\Windows\
    

GetTempName

Restituisce un nome di file temporaneo generato in modo casuale e utile per eseguire operazioni che richiedono un file temporaneo.

Il nome di file restituito non ha alcun suffisso. Nella stringa restituita, la parte relativa al percorso è la cartella di sistema dei file temporanei.

Il metodo non crea il file temporaneo.

Sintassi:

svc.GetTempName(): str

Esempio:

In Basic

      Dim fName As String
      FSO.FileNaming = "SYS"
      fName = FSO.GetTempName() & ".txt"
      ' "/tmp/SF_574068.txt"
    
In Python

      fso.FileNaming = "SYS"
      fName = FSO.GetTempName() + ".txt"
      # "/tmp/SF_574068.txt"
    

HashFile

Le funzioni di hash sono usate da alcuni algoritmi crittografici, nelle firme digitali, nei codici di autenticazione dei messaggi, nel rilevamento delle frodi, nelle impronte digitali, nei checksum (controllo di integrità dei messaggi), nelle tabelle di hash, nell'archiviazione delle password e molto altro.

Il metodo HashFile restituisce il risultato di una funzione di hash applicata ad un determinato file usando un algoritmo specificato. Il valore restituito è una stringa di cifre esadecimali con le lettere in minuscolo.

Gli algoritmi di hash supportati sono: MD5, SHA1, SHA224, SHA256, SHA384 e SHA512.

Sintassi:

svc.HashFile(filename: str, algorithm: str): str

Parametri:

filename: A string representing an existing file.

algorithm: One of the supported algorithms.

Esempio:


      ' Basic
      sHash = FSO.HashFile("C:\pagefile.sys", "MD5")
    

      # Python
      sHash = FSO.HashFile(r"C:\pagefile.sys", "MD5")
    

MoveFile

Sposta uno o più file da una posizione ad un'altra. Restituisce True se almeno un file è stato spostato o False se si verifica un errore.

An error will also occur if the source parameter uses wildcard characters and does not match any files.

Il metodo si interrompe immediatamente dopo aver rilevato un errore. Il metodo non ritorna al punto di partenza e non annulla le modifiche effettuate prima della comparsa dell'errore.

Sintassi:

svc.MoveFile(source: str, destination: str): bool

Parametri:

source: It can be a FileName or NamePattern to designate one or more files to be moved.

destination: If source is a FileName then this parameter indicates the new path and file name of the moved file.

If the move operation involves multiple files, then destination must be a folder name. If it does not exist, it is created.

If source and destination have the same parent folder, the method will rename the source.

Wildcard characters are not allowed in destination.

Esempio:

In the following examples only files are moved, subfolders are not.


      ' Basic
      FSO.MoveFile("C:\Temp1\*.*", "C:\Temp2")
    

      # Python
      fso.MoveFile(r"C:\Temp1\*.*", r"C:\Temp2")
    

MoveFolder

Sposta una o più cartelle da una posizione ad un'altra. Restituisce True se almeno una cartella è stata spostata o False se si verifica un errore.

An error will also occur if the source parameter uses wildcard characters and does not match any folders.

Il metodo si interrompe immediatamente dopo aver rilevato un errore. Il metodo non ritorna al punto di partenza e non annulla le modifiche effettuate prima della comparsa dell'errore.

Sintassi:

svc.MoveFolder(source: str, destination: str): bool

Parametri:

source: It can be a FolderName or NamePattern to designate one or more folders to be moved.

destination: If the move operation involves a single folder, then destination is the name and path of the moved folder and it must not exist.

If multiple folders are being moved, then destination designates where the folders in source will be moved into. If destination does not exist, it is created.

Wildcard characters are not allowed in destination.

Esempio:


      ' Basic
      FSO.MoveFolder("C:\Temp1\*", "C:\Temp2")
    

      # Python
      fso.MoveFolder(r"C:\Temp1\*", r"C:\Temp2")
    

OpenTextFile

Apre un file e restituisce un oggetto TextStream che può essere usato per leggere, scrivere o apportare aggiunte al file.

Fate attenzione che il metodo non controlla se il file indicato è effettivamente un file di testo.

The method returns a Null object (in Basic) or None (in Python) if an error occurred.

Sintassi:

svc.OpenTextFile(filename: str, iomode: int = 1, create: bool = False, encoding: str = 'UTF-8'): svc

Parametri:

filename: Identifies the file to open.

iomode: Indicates the input/output mode. It can be one of three constants: svc.ForReading (default), svc.ForWriting, or svc.ForAppending.

create: Boolean value that indicates whether a new file can be created if the specified filename doesn't exist:

encoding: The character set to be used. The default encoding is "UTF-8".

Esempio:

In Basic

      Dim myFile As Object
      FSO.FileNaming = "SYS"
      Set myFile = FSO.OpenTextFile("C:\Temp\ThisFile.txt", FSO.ForReading)
      If Not IsNull(myFile) Then
          ' ...
      End If
    
In Python

      fso.FileNaming = "SYS"
      myFile = fso.OpenTextFile(r"C:\Temp\ThisFile.txt", fso.ForReading)
      if myFile is not None:
          # ...
    

PickFile

Apre una finestra di dialogo per aprire o salvare file.

Se è impostata la modalità SAVE e il file selezionato esiste, sarà visualizzato un messaggio di avvertimento.

Sintassi:

svc.PickFile(defaultfile: str ='', mode: str = 'OPEN', filter: str = ''): str

Parametri:

defaultfile: This argument is a string composed of a folder and file name:

mode: A string value that can be either "OPEN" (for input files) or "SAVE" (for output files). The default value is "OPEN".

filter: The extension of the files displayed when the dialog is opened (default = no filter).

Esempio:

The examples below open a file picker with the "txt" filter applied.


      ' Basic
      aFile = FSO.PickFile("C:\Documents", "OPEN", "txt")
    

      # Python
      aFile = fso.PickFile(r"C:\Documents", "OPEN", "txt")
    

PickFolder

Apre una finestra di dialogo per selezionare una cartella.

Sintassi:

svc.PickFolder(defaultfolder: str = '', freetext: str = ''): str

Parametri:

defaultfolder: A string containing the folder name that will be displayed when the dialog is opened (default = the last selected folder).

freetext: Text to display in the dialog (default = "").

Esempio:


      ' Basic
      aFolder = FSO.PickFolder("C:\Documents", "Choose a folder or press Cancel")
    

      # Python
      aFolder = fso.PickFolder(r"C:\Documents", "Choose a folder or press Cancel")
    

SubFolders

Returns a zero-based array of strings corresponding to the folders stored in a given foldername.

L'elenco può essere filtrato con i caratteri jolly.

Sintassi:

svc.SubFolders(foldername: str, filter: str = ''): str[0..*]

Parametri:

foldername: A string representing a folder. The folder must exist. foldername must not designate a file.

filter: A string containing wildcards ("?" and "*") that will be applied to the resulting list of folders (default = "").

Esempio:

In Basic

      Dim folderList As Variant, folder As String
      FSO.FileNaming = "SYS"
      folderList = FSO.SubFolders("/home/user/")
      For Each folder In folderList
          ' ...
      Next folder
    
In Python

      fso.FileNaming = "SYS"
      folderList = fso.SubFolders("/home/user/")
      for folder in folderList:
          # ...
    
warning

All ScriptForge Basic routines or identifiers that are prefixed with an underscore character "_" are reserved for internal use. They are not meant be used in Basic macros or Python scripts.