No privileges to delete a file
Hi,
i have written a routine to read a file by using the filestream. first i do acopy from remote to local system. Then i read the files content.
After that i want to remove the file from the local system using the following command:
CtrlABBRobot.FileSystem.GetFile(strRemoteIniFile, strLocalIniFile);
Do the work here...
CtrlABBRobot.FileSystem.RemoveFile(strLocalIniFile);
This results always in an error which tells me somethin gof isufficient privileges.
What do i do wrong?
Thanks ahead.
Comments
-
According to the documentation, RemoveFile only works on the robot controller (Remote) file system.
There are a couple of alternatives you might consider:
1. If the file is not too large, you can leave it and it will be cleaned up the next time the FlexPendant restarts. This will happen because each restart reloads the same OS image.
2. If you will execute your routine several times during a single FlexPendant session, you can use the GetFile command to rename your file to the same name, which from my experience will always overwrite the existing file. This way, you can take advntage of point number 1 above.
Russell Drown0 -
Hi Russell,
this is a little bit confusing, even if this works...
In the first try, i wanted to open the file directly in the remote directory (i.e. the home directory of the controller), which was not working correctly... Not possible to open for READING !!! Then i had to copy it to the local directory, what could result in problems if there are several files and if the files may be large...., thus it should be possible to remove them anyhow, don't you agree on that?
br
Thomas
0 -
I agree, its not the simplest way of dealing with files.
I believe that there are some enhancements scheduled for FPSDK 5.08 that will permit direct access to remote (flash disk) files, which should make life much simpler. Hopefully that is still the case.
RussD2006-6-20 19:27:42Russell Drown0 -
Hello Thomas,
I destroy local copies of the files, once they are no longer necessary, with:
System.IO.File.Delete(strFileLocalCopyPath);
Hope this helps (it works for me!).Yolanda Casas0
Categories
- All Categories
- 5.5K RobotStudio
- 394 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 309 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings