How do I set a text file's attributes to read-only 
Author Message
 How do I set a text file's attributes to read-only

I create a text file in my LV application, and write strings to the
file.  I would like to set the attributes of this new file to
read-only within the same application.  Is there a way to do this in
LV?


Tue, 24 Feb 2004 02:49:58 GMT  
 How do I set a text file's attributes to read-only
Hi Kevin,
In File I/O -> Advanced File function you have Access Rights.VI. You
have to pass the rights via first 8 bits of input value. They use UNIX
format for file attributes (user/group/others). In windows, use just
bit 7 for user WRITE - set this to 0 and that means Read Only. I don't
know if you can find this VI in LV different from 6.
Another way to do it is to use a Shell Exec.VI with a shell command -
in windows will be ATTRIB +R <filename>.
You can find details in LV Help(Setting Permissions) and MS-DOS Prompt
(ATTRIB /?)


Tue, 24 Feb 2004 03:48:31 GMT  
 How do I set a text file's attributes to read-only
You can use the "Access Rights" function in File I/O>>Advanced File
Functions.  Wire a numeric with a decimal value of 292 to the "New
Permissions" input and the path to the "Path" input.  This will set
the file to read-only.  Wire a decimal value if 438 to make it
read/write.

Hope this helps

Brian



Tue, 24 Feb 2004 03:52:46 GMT  
 How do I set a text file's attributes to read-only
I forgot to mention that this VI was created by Shaun Rumbell. It is
easy to use and it can set all the file attributes in Windows! /Mikael


Tue, 24 Feb 2004 04:16:42 GMT  
 How do I set a text file's attributes to read-only
Thanks, that's exactly what I was looking for.  I fumbled with the
Access Rights.VI before, but I did not know the bit pattern for the
input value.  You hit the nail right on the head.


Tue, 24 Feb 2004 04:12:20 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Setting file attributes and Copying files

2. Setting file attributes on file creation from ZipFiles (solved)

3. Setting file attributes on file creation.

4. File Vi's and modifying file Attributes, listing by, etc

5. How do I read lines of Text from Text File and add them to Array

6. Setting Extended Attributes for files under OS/2.

7. Setting file attributes in ADA 95

8. Setting file attributes on windows.

9. Reading fortran text files / Parsing ascii files/ Help!!

10. Bidirectional text and other required i18l text attribute support

11. How do I access a file's last accessed attribute

12. file attributes on MacOS doesn't do UTF->External conversion

 

 
Powered by phpBB® Forum Software