export file permissions.

Kroboth, Joe joe_kroboth at chernay.com
Fri Jun 18 07:17:46 PDT 2010


John,

Thanks. I always appreciate your responses. I do own your filePro Survivor CD's. They have saved my countless hours of trial and error in filePro and help me breathe some new life in some of our 20+ year old applications.

For some reason I didn't think to look there. YOU are the best index for your Survivor series. I'll go back and look for that section.

Joe




> -----Original Message-----
> From: John Esak [mailto:john at valar.com]
> Sent: Thursday, June 17, 2010 6:36 PM
> To: Kroboth, Joe; filepro-list at lists.celestial.com
> Subject: RE: export file permissions
> 
> 
> Joe,
> Looks like you are being a little redundant to try and solve your
> permissions problem. No need for jsfile, just use create().... Or
> actually,
> the open() command is a superset of create(). You can open the file and
> since you've just opened it, you can set its permissions to anything
> you
> want. Have you gotten some error trying it that way?
> 
> I would take the 10 minutes it would cost to learn the syntax of the
> open()
> command and then you will be able to do anything you want with files.
> If
> EXPORT or any other function doesn't create files with the permissions
> you
> want, use open() to create the file first and then use the EXPORT
> command.
> 
> To show this works...here is about the simplest example of the open()
> command....
> 
> 
>       Then: ho(8,.0)=open("/tmp/jjjj","rwc")
>       Then: system "chmod 444 /tmp/jjjj"
>       Then: hc(8,.0)=close(ho)
>       Then: end
> This bit of code opens (or creates if necessary) a file called
> /tmp/jjjj nad
> then immediately changes its permissions to read only by everyone.
> 
> root at slave1:~# l /tmp/jjjj
> -r--r--r-- 1 filepro users 0 Jun 17 18:06 /tmp/jjjj
> 
> Now, you might never use this set of permissions, but I show you this
> to
> show you that you have complete control over the file you've just
> created.
> 
> By saying open() is a superset of create(), I am essentially saying you
> never need the create() command. Not for any reason I can think of
> anyway.
> 
> The code above just says open the file /tmp/jjjj and let me refer to it
> from
> now on until I close it as HO.  (I give HO the length and edit of an 8
> digit
> integer, because if the file can not be opened for any reason, the
> error
> message number disclosing that reason will be stored as an integer in
> HO.
> You can look this error up that number.)  The name of the file is the
> first
> argument to the open() command. Here I have used an actual "literal"
> filename "/tmp/jjjj". If you want this to be a variable name, fine, use
> any
> legitimate filePro EXPression you want here. Then, the second argument
> is a
> combination of the switches I want applied to the open() command all
> also
> shown as a string of literals. Here I've used (R)ead,(W)rite,(C)reate.
> The r
> means let me read from this file once I create it, the w means I want
> to be
> able to write to the file after it's been created, and the c tells the
> open() command to create the file if it doesn't exist already. If it
> exists
> already, the c is ignored and the other switches apply.
> 
> There are only two other switches for open, I might as well tell you
> about
> them. 0 (zero) which tells filePro to truncate the file to zero length
> if it
> finds a file is already there.  B/T are a pair of switches that say you
> are
> opening the file for Binary data or Text data.  This switch is not
> necessary
> in Unix, all files under Unix are opened for any kind of data. However,
> in
> Windows you must specify either B or T and stick to that agreement.
> 
> As some have mentioned, if you set the umask to what you want, and then
> run
> your processes that make various files, they usually will be created
> with
> this mask..
> 
> John
> 
> P.S. I have many, many movies explicitly describing all the file I/O
> commands such as open(), close(), seek(), tell(), read(), write(),
> readline(),writeline(), etc.
> 
> They are all in the filePro Survivor CD's which can be purchased at
> www.valar.com/survivor_series
> 
> Each CD has a unique search utility I provided to find any filePro
> function
> by hundred/thousands of possible names. You enter something you think
> might
> come close to what you're looking for and the utility shows you all the
> movies that might contain explanations of your keywords... No matter
> what CD
> they might be on. It  gives the movie name/description and the CD it
> resides
> on.
> 
> Aside from this, and the main purpose of the CD's is to teach *anyone*
> filePro from absolute beginner to advanced/expert level. You need no
> previous filePro experience nor filePro knowledge for these CD's to
> work.
> They work for anyone who has a desire to learn filePro.
> 
> I only throw this ad up once in a great while. I did not put it here
> because
> of anything you said Joe. Heck, you might even own the CD's already...
> I put
> it up when I see some topics that I know are covered very well by the
> CD's
> and this just seem a good time for it.
> 
> John
> 
> 
> > -----Original Message-----
> > From: filepro-list-=valar.com at lists.celestial.com
> > [mailto:filepro-list-bounces+john=valar.com at lists.celestial.co
> m] On Behalf Of Kroboth, Joe
> > Sent: Thursday, June 17, 2010 4:20 PM
> > To: filepro-list at lists.celestial.com
> > Subject: RE: export file permissions
> >
> >
> >
> > > -----Original Message-----
> > > From:
> > filepro-list-bounces+joe_kroboth=chernay.com at lists.celestial.com
> > > [mailto:filepro-list-
> > > bounces+joe_kroboth=chernay.com at lists.celestial.com] On Behalf Of
> > > Kroboth, Joe
> > > Sent: Thursday, June 17, 2010 3:52 PM
> > > To: filepro-list at lists.celestial.com
> > > Subject: RE: export file permissions
> > >
> > >
> > > > (assuming you created and used the file all within
> > processing, thus
> > > the
> > > > remove() )
> > > >
> > > > The point about the different create and remove options
> > is the proper
> > > > way to create the file depends on what you need to do
> > with it, which
> > > > you
> > > > have not disclosed. Also, "umask 0" is possibly unnecessarily
> > > > permissive. Again, because I don't know what you actually
> > need to do
> > > > with the file. umask 0 ensures anything and anyone anywhere can
> do
> > > > anything to the file, as long as filepro has closed (released
> it's
> > > > write
> > > > lock) on it, which I have included in the example code.
> > > >
> > > > --
> > > > bkw
> > >
> > > Brian,
> > >
> > > Thanks for your detailed instructions. Glad I asked. Seems like you
> > > have run into this more than a few times :-)
> > >
> > > filePro feature request: Add a way to set the permissions of files
> > > created with create or open.
> > >
> > > Joe
> > >
> >
> >
> > I found sort of a work around.  I set PFUMASK then used the
> > jsfile to create the file first.
> >
> >
> >
> >        Then: jsfile "1":cr file_name ; jsfile "1":cr-
> >                  |
> >  31  -------   -   -   -   -   -   -   -   -   -   -   -   -
> >  -   -   -   -
> >        | If:
> >                  |
> >        Then: the_file=create(file_name)
> >                  |
> >  32  -------   -   -   -   -   -   -   -   -   -   -   -   -
> >  -   -   -   -
> >
> > Seems to work.
> >
> >
> > Joe
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > Filepro-list mailing list
> > Filepro-list at lists.celestial.com
> > http://mailman.celestial.com/mailman/listinfo/filepro-list
> >



More information about the Filepro-list mailing list