LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to lock folders with labwindows CVI

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 .

 

0 Kudos
Message 1 of 10
(2,662 Views)

Are you trying to do this at the file system level, or just within your application?

0 Kudos
Message 2 of 10
(2,594 Views)

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).

Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 10
(2,587 Views)

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 ) . 

0 Kudos
Message 4 of 10
(2,564 Views)

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 

 

 

0 Kudos
Message 5 of 10
(2,550 Views)

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.

Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 10
(2,533 Views)

You might have a look at securefs ontop of winfsp This will fullfill parts of your requirements by encrypting  your files transparently.  But it won't prevent someone with admin rights to delete your files. 

0 Kudos
Message 7 of 10
(2,518 Views)

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 

0 Kudos
Message 8 of 10
(2,478 Views)

I tried this solution and  to do executable file with Cmake but there is  some files " header" missing in  this project like 

#include <clocale.h>

.

 

0 Kudos
Message 9 of 10
(2,475 Views)

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.

Rolf Kalbermatter
My Blog
0 Kudos
Message 10 of 10
(2,461 Views)