Search code examples
flowgear

Flowgear access to files on the local file system


I am creating a Flowgear workflow that needs to process a raft of XML data.

I have the xml data contained in a set of .xml files (approximately 400 files) in a folder on my local machine hard-drive and I want to read them into a workflow, run an XSLT transform and then write out the resultant XML to another folder on the same local hard-drive.

How do I get the flowgear workflow to read these files?


Solution

  • It depends on the use case, the File Enumerator works exceptionally well to loop (as in for-each) through each file. Sometimes, one wants to get a list of files in a particular folder and check whether a file has been found or not. For this, I would recommend a c# script to get a list of files with code:

    Directory.GetFiles(@"{FilePath}", "*.{extension}", SearchOption.TopDirectoryOnly);
    

    Further on, use the File node to read, write, or delete files from a file directory.

    NB! You will need to install a DropPoint on the PC/Server to allow access to the files. For more information regarding Drop Points, please click here