07-16-2014 06:15 AM
I've created an exe. and ported it from my development machine to my target. The exe calls ( needs access to) a text file. The exe /text file work fine together on my target both logged in as ADMIN and USER ( accounts). The problem is the user can go into windows explorer and gain access to the text file and conceivably chg it. Is there a way to allow the Labview exe to have read privileges from the ADMIN/USER account but not the person logged into the User Desktop?
07-16-2014 06:44 AM
07-16-2014 08:06 AM
Hey,
maybe a workaround for your problem:
Rename your file in something like: "parameters" with fileextension ".notForYourEyes" and change the data from string to Byte Array.
So no User will change something because he couldn't read it and doesn't recognize the fileextension
Regards,
CMW
07-16-2014 08:36 AM
@CMW.. wrote:
Hey,
maybe a workaround for your problem:
Rename your file in something like: "parameters" with fileextension ".notForYourEyes" and change the data from string to Byte Array.
So no User will change something because he couldn't read it and doesn't recognize the fileextension
Regards,
CMW
Changing the data to a Byte Array will not help. If I open it up in a text editor, it will still show up as normal ASCII text.
Now something I've been thinking about for another project I have is to invert all of the bytes that are written to the text file so that somebody with a text editor can't read it. This would require changing to a Byte Array and then use NOT. Write the resulting data to a binary file. When you read it, just invert the data back and you are ready to go.
07-16-2014 08:48 AM
@crossrulz wrote:
Changing the data to a Byte Array will not help. If I open it up in a text editor, it will still show up as normal ASCII text.
Now something I've been thinking about for another project I have is to invert all of the bytes that are written to the text file so that somebody with a text editor can't read it. This would require changing to a Byte Array and then use NOT. Write the resulting data to a binary file. When you read it, just invert the data back and you are ready to go.
Ahh, yes you should modify your data... invert it; would be a way to solve the readability..
I don't know if it would also be possible with the md5checksumfile.vi from the advanced file functions?
07-16-2014 08:53 AM
I thought this would be a common question. So its not as common to have an exe read from an external file and at the same time not allow a USER to access it??
07-16-2014 08:58 AM
A Mike pointed out, if you want nobody to ever touch your file, you should be using a database.
I almost always want my users to have access to the files I am using. That way they can set configuration parameters and view results.
07-16-2014 09:10 AM
Could you explain the database route??
07-16-2014 09:17 AM - edited 07-16-2014 09:20 AM
And the good news is that every Windows machine comes with at least one database preinstalled on it. Some com[puters have multiple because some programs will install instances of things like MySQL or SQLite for their own use. For instance, if you have NI's Datalogging and Supervisory Control Module installed (or ever had it installed) you also have an instance of the free version of SQL Server running on your computer.
To start off, I would read this thread. It has a lot of good information in it -- as well as drivers you can use.
Mike...
07-16-2014 09:23 AM
OK you want a data file on disk that nobody can mess with, delete or otherwise fool with for your exe.
Windows will allow users to access a file----It is sort of a "Core Feature" of any OS
So let's (re)define the actual requirement here:
You have "Data"
Thats about 8 requirements that need to be documented before "The answer" can be decided on..... A text file may not be the best method. A database may not be the best method..........it depends on a lot of other things( as I hope I made clear)