export file permissions

Brian K. White brian at aljex.com
Thu Jun 17 13:28:24 PDT 2010


On 6/17/2010 3:51 PM, Kroboth, Joe wrote:
>    
>> (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
>    

No sweat.

Also the first two blocks of code were meant to be an either/or thing 
showing two completely different possible situations, but I forgot the 
put the "Or" in between. The first is a shell script example, the second 
was an all-within-processing example.
So if you were confused that is why. Sorry!
I see I also forgot to put the close()'s in the first 2 examples though 
they are in the last 2.

Typical shell script (cron job, cgi, menu F5, etc.)

#!/bin/bash
umask 0
export T=/tmp/out.txt
rm -f $T
touch $T
rreport ...
    Then fh = open(getenv("T"),"wt")
    (You don't really need a close() in this case unless you need to do 
something with the file before exiting rreport.)
[... after rreport, do stuff with $T ...]

** OR ** (haha)
Typical clerk/report processing where the file is created, used, and 
disposed of all within processing.

Then: fn = "/tmp/out.txt"
Then: system noredraw "umask 0;rm -f "<fn<";touch"<fn
Then: fh = open(fn,"wt")
[...write to fh ...]
Then: x = close(fh)
[...do stuff with fn...]
Then: x = remove(fn)

-- 
bkw








>
> _______________________________________________
> 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