Re: cffile and files starting with '0'

2006-04-27 Thread Patrick Forsythe
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:238870
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


Re: cffile and files starting with '0'

2006-04-27 Thread Claude Schneegans
Personnally, inside a loop on a query, I tend to always specify the 
query name when using a column.
There are many cases where the current row is not correctly set by the loop.

So I would try this :

 cffile action=move source=e:\renamedatafile\#getfiles.name# 
destination=e:\renamedatafile\done\#getfiles.name#  nameconflict=overwrite 

Or even better:
cfloop query=getfiles
cfset currentFile = getfiles.name
then use currentFile instead of name in the rest of the loop.


-- 
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238875
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=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: cffile and files starting with '0'

2006-04-27 Thread Burns, John D
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


Re: cffile and files starting with '0'

2006-04-27 Thread Patrick Forsythe
unfortuatnly they all start with 0

Burns, John D wrote:

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? 
  


-- 
Patrick Forsythe
Tech Support
Smallville Communications
http://www.toto.net


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238885
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=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Solved Re: cffile and files starting with '0'

2006-04-27 Thread Patrick Forsythe
Burns, John D wrote:

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? 
  



Bingo. Closing the stream allowed it to be able to copy the file. I 
really should have seen that earlier. This list is great. I raise a beer 
or your beverage of choice to everyone that helped out.

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238887
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=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: cffile and files starting with '0'

2006-04-27 Thread Russ Michaels
have u not tried renaming the file and see if it still happens.

-Original Message-
From: Patrick Forsythe [EMAIL PROTECTED]
To: CF-Talk cf-talk@houseoffusion.com
Date: Thu, 27 Apr 2006 10:16:16 -0500
Subject: Re: cffile and files starting with '0'

 unfortuatnly they all start with 0
 
 Burns, John D wrote:
 
 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? 
   
 
 
 -- 
 Patrick Forsythe
 Tech Support
 Smallville Communications
 http://www.toto.net
 
 
 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238895
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=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Solved Re: cffile and files starting with '0'

2006-04-27 Thread Burns, John D
Glad it worked. That seems odd that it gave you the error that it did.
It seems that it would have given you a this file is in use error or
something. 


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 11:22 AM
To: CF-Talk
Subject: Solved Re: cffile and files starting with '0'

Burns, John D wrote:

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?
  



Bingo. Closing the stream allowed it to be able to copy the file. I
really should have seen that earlier. This list is great. I raise a beer
or your beverage of choice to everyone that helped out.



~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238958
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=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: cffile and files starting with '0'

2006-04-27 Thread Denny Valliant
On 4/27/06, Claude Schneegans [EMAIL PROTECTED] wrote:

 Personnally, inside a loop on a query, I tend to always specify the
 query name when using a column.
 There are many cases where the current row is not correctly set by the
 loop.


I've run into it too. It's logical when you figure it out, but sometimes
it's easier to
get the specific currentrow for the query, so something more like:
  getfiles[name][getfiles.currentrow] (iirc)

:-)enny

when I think back to all the crap I learned in highschool...
my lack of education hasn't hurt me none.


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:239013
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


RE: cffile and files starting with '0'

2006-04-26 Thread Ben Nadel
Call me crazy, but tryin doing a 

cfdump var=#FileExists(  File path  )# /
cfabort / 

Before the CFFile... Make sure that that is YES. If not, then maybe
something else is going wrong.


...
Ben Nadel 
www.bennadel.com
-Original Message-
From: Patrick Forsythe [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 26, 2006 3:30 PM
To: CF-Talk
Subject: cffile and files starting with '0'

Has any one seen any weirdness with trying to do a move using cffile with
files that start with '0' (zero)?

It keeps telling me that The value of the attribute source, which is
currently e:\renamedatafile\0508302.csv, is invalid.  

but I know the file is there.
Server CF MX
Windows 2000

Thanks

--
Patrick Forsythe
Tech Support
Smallville Communications
http://www.toto.net




~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238823
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


RE: cffile and files starting with '0'

2006-04-26 Thread Burns, John D
Umm, this is a shot in the dark, but is there any chance that you're
missing a d in the folder name. Currently, it looks like it's rename
data file minus the spaces. I'm thinking maybe it is really named
renameD data file or something like that. Could be off, but just
figured I'd throw it out. 


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

-Original Message-
From: Ben Nadel [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 26, 2006 4:03 PM
To: CF-Talk
Subject: RE: cffile and files starting with '0'

Call me crazy, but tryin doing a 

cfdump var=#FileExists(  File path  )# / cfabort / 

Before the CFFile... Make sure that that is YES. If not, then maybe
something else is going wrong.



Ben Nadel
www.bennadel.com
-Original Message-
From: Patrick Forsythe [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 26, 2006 3:30 PM
To: CF-Talk
Subject: cffile and files starting with '0'

Has any one seen any weirdness with trying to do a move using cffile
with files that start with '0' (zero)?

It keeps telling me that The value of the attribute source, which is
currently e:\renamedatafile\0508302.csv, is invalid.  

but I know the file is there.
Server CF MX
Windows 2000

Thanks

--
Patrick Forsythe
Tech Support
Smallville Communications
http://www.toto.net






~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238825
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=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: cffile and files starting with '0'

2006-04-26 Thread Patrick Forsythe
cfdump var=#FileExists(  File path  )# /
cfabort / 

Before the CFFile... Make sure that that is YES. If not, then maybe
something else is going wrong.
  

comes back with a YES

-- 
Patrick Forsythe
Tech Support
Smallville Communications
http://www.toto.net


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238826
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=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: cffile and files starting with '0'

2006-04-26 Thread Patrick Forsythe
Burns, John D wrote:

Umm, this is a shot in the dark, but is there any chance that you're
missing a d in the folder name. Currently, it looks like it's rename
data file minus the spaces. I'm thinking maybe it is really named
renameD data file or something like that. Could be off, but just
figured I'd throw it out. 
  

I rechecked and it is rename data file

-- 
Patrick Forsythe
Tech Support
Smallville Communications
http://www.toto.net


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238828
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


RE: cffile and files starting with '0'

2006-04-26 Thread Burns, John D
You should try moving the file to somewhere like
C:\filetest\filename.csv and try copying it to C:\filetest2\filename.csv
and try to narrow down that it's the filename causing issues and not
something else in the path. 


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

-Original Message-
From: Patrick Forsythe [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 26, 2006 4:20 PM
To: CF-Talk
Subject: Re: cffile and files starting with '0'

Burns, John D wrote:

Umm, this is a shot in the dark, but is there any chance that you're 
missing a d in the folder name. Currently, it looks like it's 
rename data file minus the spaces. I'm thinking maybe it is really 
named renameD data file or something like that. Could be off, but 
just figured I'd throw it out.
  

I rechecked and it is rename data file

--
Patrick Forsythe
Tech Support
Smallville Communications
http://www.toto.net




~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238831
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


RE: cffile and files starting with '0'

2006-04-26 Thread Ian Skinner
Where exactly is the failure?  Are you trying to use the name of the file in 
some variable that is causing the problem?  If so you could be running into a 
bit of a problem with CF's stateless nature; such that CF is treating that 
value as an integer and dropping the leading zero.


--
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

-
| 1 |   |
-  Binary Soduko
|   |   |
-
 
C code. C code run. Run code run. Please!
- Cynthia Dunning

Confidentiality Notice:  This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message. 




~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238832
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


Re: cffile and files starting with '0'

2006-04-26 Thread Patrick Forsythe
that is a point I hadn't thought of, I am basically do a cfdirectory to 
get all the file names then doing a cfloop and moving each file.

Ian Skinner wrote:

Where exactly is the failure?  Are you trying to use the name of the file in 
some variable that is causing the problem?  If so you could be running into a 
bit of a problem with CF's stateless nature; such that CF is treating that 
value as an integer and dropping the leading zero.


--
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

-
| 1 |   |
-  Binary Soduko
|   |   |
-
 
C code. C code run. Run code run. Please!
- Cynthia Dunning

Confidentiality Notice:  This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message. 






~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238833
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


RE: cffile and files starting with '0'

2006-04-26 Thread Ian Skinner
that is a point I hadn't thought of, I am basically do a cfdirectory to 
get all the file names then doing a cfloop and moving each file.

Ian Skinner wrote:

Where exactly is the failure?  Are you trying to use the name of the 
file in some variable that is causing the problem?  If so you could be 
running into a bit of a problem with CF's stateless nature; such that 
CF is treating that value as an integer and dropping the leading zero.

I would guess this it the problem.  CF is seeing the value as an integer and 
dropping the leading zero in your loop.  You can try the toString() function 
around the value in the loop to let CF know you do not want to treat this value 
as a number.

--
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

-
| 1 |   |
-  Binary Soduko
|   |   |
-
 
C code. C code run. Run code run. Please!
- Cynthia Dunning

Confidentiality Notice:  This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message. 




~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238834
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


Re: cffile and files starting with '0'

2006-04-26 Thread Patrick Forsythe
I would guess this it the problem.  CF is seeing the value as an integer and 
dropping the leading zero in your loop.  You can try the toString() function 
around the value in the loop to let CF know you do not want to treat this 
value as a number.
  

tried that and still get  The value of the attribute source, which is 
currently e:\renamedatafile\0508302.csv, is invalid

-- 
Patrick Forsythe
Tech Support
Smallville Communications
http://www.toto.net


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238835
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=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: cffile and files starting with '0'

2006-04-26 Thread Ben Nadel
See if you can do a CFFile Read on it... If that works, then perhaps it
permissions on the folder that need more than READ. 

...
Ben Nadel 
www.bennadel.com
-Original Message-
From: Patrick Forsythe [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 26, 2006 5:07 PM
To: CF-Talk
Subject: Re: cffile and files starting with '0'

I would guess this it the problem.  CF is seeing the value as an integer
and dropping the leading zero in your loop.  You can try the toString()
function around the value in the loop to let CF know you do not want to
treat this value as a number.
  

tried that and still get  The value of the attribute source, which is
currently e:\renamedatafile\0508302.csv, is invalid

--
Patrick Forsythe
Tech Support
Smallville Communications
http://www.toto.net




~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238837
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=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: cffile and files starting with '0'

2006-04-26 Thread Claude Schneegans
 tried that and still get  The value of the attribute source, which is
currently e:\renamedatafile\0508302.csv, is invalid

It might help if you could show us the part of the code implied.

-- 
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238840
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