Do you need to close the stream you have open in java in order to copy
it? By the way, I'm not sure if this was asked, but does this work for
all of the files other than the ones that begin with 0? 


John Burns
Certified Advanced ColdFusion MX Developer
Wyle Laboratories, Inc. | Web Developer
 

-----Original Message-----
From: Patrick Forsythe [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 27, 2006 10:47 AM
To: CF-Talk
Subject: Re: cffile and files starting with '0'

Here is the code for those that have asked for it. permissions on the
folder are all good.

<cfdirectory action="list" name="getfiles" 
directory="e:\renamedatafile\" filter="*.csv"> <cfloop query="getfiles">
  <cfoutput>---#Name#---<br />
  </cfoutput>
 
  <cfscript>
 fileReader = CreateObject("java", "java.io.FileReader");
fileReader.init("e:\\renamedatafile\\#name#");
 br = CreateObject("java", "java.io.BufferedReader");
br.init(fileReader); </cfscript>

  <cftry>
    <cfloop condition="true">
     
        <cfscript>
            line = br.readLine();
        </cfscript>
     
      <cfoutput>
         <cfif imagename neq "Thumbs.db">
          <cfquery datasource="imagevault">
            UPDATE photo SET photostatusid = 2, digloc = 19, photoname =
'#listgetat(line,2)#' WHERE imagenum =#imagename#
          </cfquery>
        </cfif>
      </cfoutput>
  
    </cfloop>
  
    <cfcatch type="coldfusion.runtime.UndefinedVariableException">
      <!--- this indicates end of file, ok to ignore error --->
    </cfcatch>
   
  </cftry>


  <cffile action="move" source="e:\renamedatafile\#name#" 
destination="e:\renamedatafile\done\#name#"  nameconflict="overwrite" >
</cfloop>




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238877
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to