export file permissions

Brian K. White brian at aljex.com
Thu Jun 17 13:32:19 PDT 2010


On 6/17/2010 4:20 PM, Kroboth, Joe wrote:
>
>    
>> -----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
>
>    

Nice.
I HATE forking processes (running system()) just for no other reason 
that to get a file created with specific permissions which I can and do 
otherwise create/write/use/remove all from native processing. grr...
I'll try that on something and see if it's a good replacement in general.

Thanks!

-- 
bkw


More information about the Filepro-list mailing list