gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [open-cobol-list] File permissions


From: Bill Klein
Subject: Re: [open-cobol-list] File permissions
Date: Sat, 14 Mar 2009 13:10:14 -0500

List (Brian, John, and Roger)
  I don't know if this is of any interest to OpenCOBOL, but IBM's Enterprise
COBOL has a facility that COULD be a model for doing this in "native COBOL".

In IBM's COBOL, you can explicitly set an environment variable (using putenv
or equivalent LE service) to set an association between the name in the
Select/Assign clause with the "physical file name" *AND* for specific
"system attributes" for new files.  See:
  http://publibfp.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/igy3lr40/4.2.3.1 
and
  http://publibfp.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/igy3lr40/4.2.3.2 

OBVIOUSLY, the kind of thing that IBM MVS need/want to "define" is totally
irrelevant for OpenCOBOL environment.  On the other hand, using this as a
model,, couldn't one explicitly set permission mode for "created files" if
you "associated" the COBOL file name with an environment variable that
included the information?

As I say, this is "just a thought" and NOT something that I am asking for -
much less asking for as a high priority.

> -----Original Message-----
> From: Brian Tiffin [mailto:address@hidden 
> Sent: Saturday, March 14, 2009 12:42 PM
> To: address@hidden
> Subject: Re: [open-cobol-list] File permissions
> 
> Hi John,
> 
>    I don't think this can be done with COBOL syntax.  But aside from 
> calling "SYSTEM" with a chmod command after the fact, you can 
> (on POSIX 
> systems) modify the file creation mask.  Take a look at the 
> man page for 
> umask.  This will influence the default file creation 
> settings before the 
> fact.
> 
> Cheers,
> Brian
> 
> On March 14, 2009 11:12:48 am John Culleton wrote:
> > When I create a new file, is there a way to control output
> > file permissons from within the COBOL program? I thought of
> > using CALL "system" etc. but perhaps there is an easier way.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]