This content has been marked as final.
Show 2 replies
-
1. Re: CF9/10: Change file attributes
BKBK Apr 19, 2014 6:43 AM (in response to WolfShade)An example on Windows, using 3 steps:
<cfset path_to_directory="C:\Users\BKBK\Desktop">
<!--- Create readOnly blank text file --->
<cffile action="write" attributes="readonly" file="#path_to_directory#\testFile.txt" output="">
<!--- Disable readOnly attribute --->
<cffile action="rename" attributes="normal" source="#path_to_directory#\testFile.txt" destination="#path_to_directory#\testFile.txt">
<!--- Write some text to file, switching readOnly attribute back on --->
<cffile action="write" attributes="readonly" file="#path_to_directory#\testFile.txt" output="Some text">
Done!
-
2. Re: CF9/10: Change file attributes
WolfShade Apr 21, 2014 5:49 AM (in response to BKBK)!!!
Thanks, BKBK! I tried using append with attributes, that didn't work.. hadn't thought of rename. Brilliant!
V/r,
^_^


