File Perms

[email protected] (Bas Kamer) Thu, 16 Nov 2006 16:10:28 +0100
Newsgroups php.smarty.dev
Message-ID <[email protected]>
Hi,

i have a quick improvement for smarty for people using the  
_file_perms property.

in file

smarty-2.6.14/libs/internals/core.write_file.php:47

-    @chmod($params['filename'], $smarty->_file_perms);
+    @chmod($params['filename'], octdec($smarty->_file_perms));

This improves file chmod behavior...

on my installation a setting of (string) "0666" yields very  
unexpected results unless i use the octdec method...

please note that in my case this string is not hardcoded into the  
smart class, but dynamically written at some point (eventough it is  
designated as 'private', which is why????)

thanks... good luck, it a very nice product.

Just like to contribute something here...
ps. If this is not the correct place for this please let me know...

references: http://www.php.net/octdec
and the comment on
http://nl3.php.net/manual/en/function.chmod.php#56077

again

thanks a lot...

Bas Kamer