House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

CFFILE APPEND at the beginning

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Hi all,
CFDEV
06/01/04 11:13 A
<cfset crlf = chr(13) & chr(10)>
Pascal Peters
06/01/04 11:26 A
Thanks a lot,
CFDEV
06/01/04 11:32 A
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
CFDEV
06/01/2004 11:13 AM

Hi all, The cffile append function append a document at the end..how could I insert a line at the beginning instead? Thanks Pat

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Katz, Dov B (IT)
06/01/2004 11:19 AM

Prepending to a file involves reading and rewriting the file.  CFFILE read, and CFFILE write with #newstring# newline #existing file# But if it's a one time thing, you might want to do this dynamically when you output the file by outputting the "header" line before the file content. HTH -dov   _____ Sent: Tuesday, June 01, 2004 11:11 AM To: CF-Talk Subject: CFFILE APPEND at the beginning Hi all, The cffile append function append a document at the end..how could I insert a line at the beginning instead? Thanks Pat   _____  

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Pascal Peters
06/01/2004 11:26 AM

<cfset crlf = chr(13) & chr(10)> <cffile action="READ" file="#variables.file#" variable="out"> <cfset out = "my line here" & crlf & variables.out> <cffile action="WRITE" file="#variables.file#" output="#variables.out#" addnewline="No"> Of course, this requires reading the whole file. If you are on cfmx, maybe this can be done in java? Pascal ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
CFDEV
06/01/2004 11:32 AM

Thanks a lot, I tought of that but I was sonwdering if there was something I missed in the append attributes to facilitate the manipulation... Thank you Pat   _____ Sent: June 1, 2004 11:21 To: CF-Talk Subject: RE: CFFILE APPEND at the beginning <cfset crlf = chr(13) & chr(10)> <cffile action="READ" file="#variables.file#" variable="out"> <cfset out = "my line here" & crlf & variables.out> <cffile action="WRITE" file="#variables.file#" output="#variables.out#" addnewline="No"> Of course, this requires reading the whole file. If you are on cfmx, maybe this can be done in java? Pascal ----- Excess quoted text cut - see Original Post for more -----   _____  


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

September 09, 2010

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30