06-11-2009 09:35 AM - edited 06-11-2009 09:40 AM
I've written an application in LabVIEW 8.6 that launches from CD. It copies a master Real-Time image (taken using the RealTime System Replication Tools) to the user's local PC temporary directory, then edits one of the files in that repository to suit the user's set-up (IP etc.), then flashes the image onto the RT system.
The problem I've got is - I cannot delete the temporary files when I'm finished because the files are all set to read only. Why read-only? Because they were copied from the CD, where they are all necessarily Read-only, and Windows copies that attribute across to the local PC files too. Now, the LabVIEW File Permissions primitive is useless. It won't let me change the read-only flag for the whole folder, just one file at a time. So consequently I cannot delete the folder of temporary files easily.
How can I change the attributes of a complete folder of files from read-only to writeable such that I can then go ahead and delete them? There are literallyhundreds of files here...
Solved! Go to Solution.
06-11-2009 10:15 AM
06-11-2009 10:24 AM
06-11-2009 11:37 AM
Hi there
LV 8.6 documentation for "Set Permissions Function" states:
Sets the owner, group, and permissions of the file or directory specified by path. This function does not work for files inside an LLB.
Which version is yours LV?
06-11-2009 04:32 PM
06-11-2009 04:48 PM
06-12-2009 03:04 AM
04-18-2013 01:25 AM - edited 04-18-2013 01:37 AM
I realise this is quite an old thread but I still couldn't find an elegant solution in the LabVIEW forum.
I like to try and store my application information the recommended way, in an ini file in the application public data section.
However, as a number of people have already pointed out, this doesn't work for another user logging in because the OS has only allowed write permissions to the original user.
The System Exec approach seems a bit to untidy to me, unprofessional maybe?
So yesterday I decided to do battle with MS Windows and get file premissions working in LabVIEW (using .NET).
Here is the result of my efforts, I hope it is useful to someone, even if just as example code of .NET for Windows in LabVIEW.
It adds the 'Everyone' identity to the file security and gives it full control.
I tried to put some meaningful documentation in there so if I ever have to go back to it I have some hope of understanding why it's doing what it is doing.
04-18-2013 07:21 AM
07-16-2013 10:34 AM
very nice job, but in my case it is not fully working: I can only set permissions but not clear them