RobotStudio event

PC SDK 2021.3 FileSystem.GetDirectory

Options
Moin! (Means 'hello!' in northern germany)

I can't figure out, what went wrong, with the use of Filesystem.GetDirectory as you can see in attached picture.

Answers

  • Hello there,

    Unfortunately I don't have access to a RC right now, but I've looked into this a bit from the VC-side I was able to get the folder TestFolder from the controllers Home-directory to a directory on my PC with the following syntax:

    Controller.FileSystem.GetDirectory("Backup", "C:\\Users\\XYZ\\Downloads\\TestFolder", true);

    This command will take the folder contents from "HOME/Backup" on the controller and place it into "C:\\Users\\XYZ\\Downloads\\TestFolder"

    The path2 exception happens if I change "Backup" to "ctrl:Backup"

    Can you please show me the reference that tells you to add the "ctrl:" to your remoteDirectory?

    Maxim Riabichev
    PC Software Support Engineer
  • System.IO.DirectoryNotFoundException
      HResult=0x80070003
      Message=ctrl:/hd0a/1.020IR1/HOME/hd0a/BACKUP/1.020IR1_20210812_1033

    As you can see in above message, there is "ctrl:" needed in the command.
  • Ok, that was a mistake.
    But now it is working
    Thanks for your help!

    [CODE]
                                controller.Backup("(BACKUP)$/" + backupDir);

                                do
                                {
                                    this.Cursor = Cursors.WaitCursor;
                                    System.Threading.Thread.Sleep(200);
                                    this.Cursor = Cursors.Default;
                                } while (controller.BackupInProgress);

                                controller.FileSystem.RemoteDirectory = "/hd0a";

                                string recDir = "D:\\Backup\\" + backupDir;
                                string sendDir = "/BACKUP/" + backupDir;

                                controller.FileSystem.GetDirectory(sendDir, recDir);
    [CODE/]