Setting file attributes in ADA 95 
Author Message
 Setting file attributes in ADA 95

I am creating a program that writes a file on a Sun box. I need to set the
file attriutes to read / execute so other users can access the file, i.e
<chmod 755 filename>. I am new to ADA so any help would be appreciated. BTW
I am using the GNAT complier.

TIA,
Jason Yates
Clemson University



Fri, 26 Mar 1999 03:00:00 GMT  
 Setting file attributes in ADA 95


Quote:

>I am creating a program that writes a file on a Sun box. I need to set the
>file attriutes to read / execute so other users can access the file, i.e
><chmod 755 filename>. I am new to ADA so any help would be appreciated. BTW
>I am using the GNAT complier.

The best way of doing this is by using the POSIX 1003.5 standard binding
(is there one for GNAT ?). Ada's standard IO packages are far from a full
interface to the unix filesystem.


Fri, 26 Mar 1999 03:00:00 GMT  
 Setting file attributes in ADA 95

Jason said

"I am creating a program that writes a file on a Sun box. I need to set the
file attriutes to read / execute so other users can access the file, i.e
<chmod 755 filename>. I am new to ADA so any help would be appreciated. BTW
I am using the GNAT complier.
"

Be sure to look at package Ada.Text_IO.C_Streams in file a-tiocst.ads
which allows you to gt your hands on the c stream in use, so you acn
call standard C routines for messing with such things. There are
similar packages for direct and seqeuntial IO.



Sat, 27 Mar 1999 03:00:00 GMT  
 Setting file attributes in ADA 95

This is not an Ada question. You can set your umask to 022 to get
everything but the execute (x) bit. At the end of generation, a script
command using chmod could also do it. You could also import a "C"
subroutine which issues the chmod command, if your Ada does not include the
"system" command.

cheers
bob



Quote:
> I am creating a program that writes a file on a Sun box. I need to set
the
> file attriutes to read / execute so other users can access the file, i.e
> <chmod 755 filename>. I am new to ADA so any help would be appreciated.
BTW
> I am using the GNAT complier.

> TIA,
> Jason Yates
> Clemson University




Sat, 27 Mar 1999 03:00:00 GMT  
 
 [ 4 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. LGL Seminar: GNU Ada 95 and Mixed Language Programming with Ada 95

5. LGL Seminar: GNU Ada 95 and Mixed Language Programming with Ada 95

6. Newbie: need help setting up Ada 95

7. WINDOWS 95. SET FILE=XX error

8. How do I set a text file's attributes to read-only

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

10. Setting file attributes on windows.

11. Redocumenting Ada 83 code to 95 - in wordprocessor files

12. Details of New Files on Mar 95 Ada CDROM

 

 
Powered by phpBB® Forum Software