Forum Migration Notice
Update (2026-01-21): The user forums are now in read-only mode pending the data migration.

Update (2026-01-12): The user forums will be put into read-only mode on the 21st of January, 00:00 CET, to prepare for the data migration.

We're transitioning to a more modern community platform by beginning of next year. Learn about the upcoming changes and what to expect.

Get an exception when trying to load txt file using PutFile

Hi, 

I'm trying to load listbox items names from database.txt, which is located in the HOME/Database directory on real robot controller. 
I get an exception "SYS_CTRL_E_FILE_NOT_FOUND" (File not found or could not be opened for reading). What am I doing wrong?


       //Creating controller object
        public static Controller aController = new Controller();

        //Loading listbox items from txt
        private void TpsViewDatabase_Load(object sender, EventArgs e)
        {
            //Accessing files and directories
            FileSystem aFileSystem = aController.FileSystem;

            //Creating  remote directory
            aController.FileSystem.RemoteDirectory = "HOME/Database";
            string remoteDir = aController.FileSystem.RemoteDirectory;

            aController.FileSystem.LocalDirectory = "c:/temp";

            //Saving txt to controller remote directory
            aController.FileSystem.PutFile("database.txt", remoteDir);

                using (StreamReader sw = new StreamReader(remoteDir + "/database.txt"))
                {
                    listViewItem1.Text = sw.ReadLine();
                    listViewItem2.Text = sw.ReadLine();
                    listViewItem3.Text = sw.ReadLine();
                    ...
                }
            }
        }

        //Exiting
        private void button1_Click(object sender, EventArgs e)
        {
            //this.Hide();
            this.CloseMe();

            if (aController != null)
            {
                aController.Dispose();
                aController = null;
            }
        }

Regards