Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


osirisja
2011-12-29T09:31:30Z
Hi Support

I am trying to List files in a folder that were created using an FTP Download task, but in the LIST I only want to list the Filenames, and not the folder name as well. I have defined the following Folder definition in the List Task Location tab, using the PATH function:

{PATH(GetFileName|c:\@@Trigger\CTS\Xfer\{DATEFORMAT(yyyyMMdd)})}

However, it is returning an error saying:

'Could not find a part of the path 'C:\Windows\system32\20111229'.'

It seems as if it is not recognising the Path I have defined correctly. I have to hardcode the path name as the FTP Download task doesn't return any VC variables I can use to tell me what folder it wrote to. Am I using the function within the task incorrectly?

Cheers

Andy
Sponsor
Forum information
Support
2011-12-29T09:52:03Z
Ok, that won't work. I am moving this topic to Feature request. Want you need is an Output tab where you can decide the format of the result.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Support
2011-12-29T09:59:37Z
One solution is to use the .NET Execute Task with the following code:

using System;
using System.IO;
using System.Text;

public class Test
{
    public static string GetFileList(string baseFolder)
    {
        StringBuilder sb = new StringBuilder();
        string[] files = Directory.GetFiles(baseFolder, "*");
        foreach (string f in files)
        {
            sb.AppendLine(Path.GetFileName(f));
        }
        return sb.ToString();
    }
}

Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
osirisja
2011-12-29T11:09:43Z
Hi Henrik

An Output Tab would be a better solution. Even better would be to allow an FTP List task as well :-)

I want to try not to get into too much .NET coding if possible as I need to hand the VC implementation over to a team who are not familiar with .NET.

Cheers

Andy
Scroll to Top