Skip to content

File system connector

tomdam edited this page Jun 17, 2020 · 1 revision

File system connector is a SPCoder module that can be used to connect to a specific folder/drive and to show the file structure in SPCoder's Explorerview. It can connect to a local or UNC path.

Connecting

You can connect to a folder/drive by entering the path to Explorerview address field, choosing the File system connector and clicking the Connect button. The other way to connect to a folder/drive is by calling the main.Connect method:

main.Connect(@"C:\", "File system");
main.Connect(@"\\myothermachine\Share", "File system");

File system connector

Usage

After the connection is made, SPCoder will add the root folder to the Context window and name the variable directoryinfo (In case the variable with the same name already exists, it will append the number to the name, similar to directoryinfo1 or directoryinfo2)

File system 2

You can then write your code to call the members of System.IO.DirectoryInfo object. For instance, the following code writes the names of all subfolders to Output window:

var folders = directoryinfo.GetDirectories();
foreach(var f in folders)
{
    println( f.FullName);
}

Actions

SPCoder Explorerview shows the context menu when an item is clicked with right mouse button. When you right-click on an item added by File connector, the following menu actions are available:

  • Files
    • Open - displays the content of the file in SPCoder code editor
    • Open in application - opens the file in system application
    • Show data in grid - gets the content of the first sheet of excel file and shows it in GridViewer - This item was added using a plugin - only available for .xlsx files
  • Subfolders
    • Open in explorer - opens the folder in System file explorer

File system 4

File system 5