10-07-2019 09:43 AM
Dear ALL,
I have application with several folders like :
Exemple : Main_folder --------------------> Folder_01
--------> Folder_02
--------> Folder_03
--------> Folder_04
----------------------
The main folder contains several folders, so I would like to know if it possible with labwindows CVI to develop a program to lock and Unlock folder " Exemple : lock => Folder_01 and Folder_02 , Unlock ==> Folder_03 and Folder_04 "
these folder contains our sequence test that is developed by CVI.
So if there is some command or instruction to use to develop this programme ,
Thank you in advance .
10-08-2019 12:36 PM
Are you trying to do this at the file system level, or just within your application?
10-08-2019 01:28 PM - edited 10-08-2019 01:29 PM
You need to explain what you mean with locking a folder. So that your application can't use it? Or that you can't move it in Explorer? Or even that you can't look at it in Explorer?
If it is your application, you need to implement it yourself. If it is about not being able to look at it in Explorer, you can't prevent that.
If it is about not being able to Move (not Copy!) or Delete the folder, any folder in Windows where an application has a file opened in can't be moved (and deleted which is a move into nowhere too).
10-09-2019 03:18 AM
Please define more exactly what means "lock a folder". If it means "restrict access to that folder" you might want to read about ACLs ( https://docs.microsoft.com/en-us/windows/win32/secauthz/access-control ) .
10-09-2019 03:59 AM
Dear all ,
Sorry if I wasn't clear in my explanation so :
we develop a test benches to test product at the end of line of production and and we use an application that also we developed under CVI .
our application or tester contains many folder , some folder I need to give access to operator of production to add reference and model of product and add some parameters in ini file , but some folder that contains sources code I would like to set a password for folders it means when we click in the folder request a password and also prohibit to remove a folder.
our test bench are installed in many plant in different country, so if we use access control windows the IT( Informatic service) local can change because they are also administrators , so I would like to develop a code under CVI to make a password to folder also for bin folder it means the password mustn't prohibit to the tster to use DLL in folder been
Thank you very much
10-09-2019 06:03 AM
If ACL protection is not an option then you are in a hard place. Basically you want to implement an application level protection that must work on system level (otherwise the Explorer can get to the files too) but should not prevent the system from accessing the files (because you want Windows to be able to access DLLs inside those folders anyhow).
Do you see the conflict? The system should have access to it but Explorer not, and that uses the same system APIs too.
Basically this would only be doable with a custom filesystem filter driver and that is kernel development territory, something you need to have special tools (the Microsoft Windows C compiler and DDK tools) and special skills too (kernel driver development is advanced technology and your requirement to have some authentication mechanism in there adds extra complexity since a safe encryption technology is a very special programming area in itself.
If the requirement for the system to find files in those locations can be left out you could consider using password protected ZIP files for storing your super secret special stuff files in.
10-09-2019 07:29 AM
10-10-2019 09:40 AM
Thank you for your explanation , I see the conflict , the application must have access to folder but not to user when he click on the folder.
Use zip file is a good solution for the file that don't need a loft change, the problem if I use zip file it will not be praticable to unzip and ZIp because we have a lot of test bench and every time we touche some files and add parameters or change in test sequences and we have a lot of folders.
that is why I'm looking for the solution of one password for a group of folders like that with one password access available to the all folder of application
10-10-2019 09:43 AM
I tried this solution and to do executable file with Cmake but there is some files " header" missing in this project like
.
10-10-2019 01:57 PM
Actually the minizip implementation which is part of the zlib distribution also supports stream access to files inside a ZIP file. That means rather than having to extract the files to the disk and reading them from there it is possible to simply read them into a memory buffer directly. And updating works directly from a memory buffer too.
It's not an out of the box experience to get this library to compile and to use it's API, especially the stream versions of the functions but it can be done.