[ic] Usertag and permissions on create file

Stefan Hornburg (Racke) racke at linuxia.de
Fri Sep 19 18:02:33 UTC 2008


m.mescoli at omnib.it wrote:
> m.mescoli at omnib.it ha scritto:
>> Perl beginner.
>>
>> With an usertag i create a png plot file with umask permission 0660. 
>> This permissions do not permits apache to read the file and trasmit it 
>> to web clients. How create and write a file inside usertag with read 
>> permission for all ?
>>
>> Thanks
>> Marco Mescoli
> Sorry but i don't understand. After more attempts to permit to overwrite 
> old file or create a new one and leave it readable:
> ...
> my $prevumask = umask 0002;
> open( GRAPH, "> $GRAPH" ); # file created has -rw-rw-r-- perms octal 0664
> ...
> ...
> close( GRAPH );
> umask = $prevumask; # reset file permission
> ------------------------------------------
> But why setting umask to octal 0002 it create the file with octal 0664 
> perms ?

Just use $Tag->write_relative_file :-).

$ret = $Tag->write_relative_file({auto_create_dir => 1,
	umask => 002,
	file => "images/artikel/abc.png",
	body => $Scratch->{image}});

http://docs.icdevgroup.org/cgi-bin/online/tags/write-relative-file.html

Regards
          Racke

-- 
LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team




More information about the interchange-users mailing list