RE: File disappears after cffile rename

2007-10-22 Thread Manju Kiran P Pacchhipulusu
Hi Michael,

Apparently on CF8, if the cffile.serverfile name and the newly
assigned name var are the same, the file will get deleted when it fires
the cffile rename.

I tried this simple code and wasn't able to reproduce this issue.

cffile action=RENAME source=C:\temp1.txt
destination=C:\temp1.txt

The file temp1.txt wasn't deleted.

Am I missing something?

Please let me know.  If it is a bug, we need to fix it.

Thanx
-Manjukiran
Adobe ColdFusion Team


~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291736
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: File disappears after cffile rename

2007-10-18 Thread Michael E. Carluen
I am still trying to wrangle this issue.

 

cflock name=#CreateUUID()# type=exclusive timeout=30
throwontimeout=no

cfset PAGE_clean_SERVERFILE = replace(cffile.SERVERFILE, ,_,all)


cffile action=RENAME source=cffile.SERVERFILE#
destination=#PAGE_clean_SERVERFILE#

/cflock

 

Since this is an avi file being uploaded on a fairly new server, does my
MIME registration on IIS have anything to do with the cffile rename anomaly?
I currently have it for video/avi.

 

Any other ideas for me to check for, will help.

 

Thanks,

 

Michael

 

 

 -Original Message-

 From: Michael E. Carluen [mailto:[EMAIL PROTECTED]

 Sent: Thursday, October 18, 2007 3:09 AM

 To: CF-Talk

 Subject: File disappears after cffile rename

 

 Has anyone experienced having a file literally disappear after a cffile

 action=rename ?

 

 

 

 This happens on CF8. but code works fine on 7.0.2.

 

 

 

 Any ideas?

 

 

 

 

~|
Enterprise web applications, build robust, secure 
scalable apps today - Try it now ColdFusion Today
ColdFusion 8 beta - Build next generation apps

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291424
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: File disappears after cffile rename

2007-10-18 Thread Brad Wood
On a side note, I can't think of a reason you would want to use a named
lock, but use a random name every time.  Since the point of a named lock
is to make sure only one thread at a time can execute the code inside
cflocks of the same name; generating locks with random names seems
pointless since no two locks would ever have anything to wait on.  

If you want to keep two pages from writing to the same file or directory
at the same time, use the full file path or directory path as the lock
name.

~Brad

-Original Message-
From: Michael E. Carluen [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 18, 2007 12:01 PM
To: CF-Talk
Subject: RE: File disappears after cffile rename

I am still trying to wrangle this issue.

 

cflock name=#CreateUUID()# type=exclusive timeout=30
throwontimeout=no

cfset PAGE_clean_SERVERFILE = replace(cffile.SERVERFILE, ,_,all)


cffile action=RENAME source=cffile.SERVERFILE#
destination=#PAGE_clean_SERVERFILE#

/cflock

~|
ColdFusion 8 - Build next generation apps
today, with easy PDF and Ajax features - download now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291435
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: File disappears after cffile rename

2007-10-18 Thread Paul Vernon
cflock name=#CreateUUID()# type=exclusive timeout=30
throwontimeout=no
cfset PAGE_clean_SERVERFILE = replace(cffile.SERVERFILE,  , _,
all)
cffile action=RENAME source=cffile.SERVERFILE#
destination=#PAGE_clean_SERVERFILE#
/cflock

Firstly, the CFLOCK as you have it is pointless. Using a CreateUUID()
function to name a lock simply creates a lock that is uniquely named and
offers no protection to the code running inside. 

Your mileage may vary if you call the lock name fileUpload or if you need
more granularity, #cffile.serverfile#.

Next, I'm not sure if the code you've entered is a copy paste or a retype
(I'm assuming a re-type) because you have an error in the cffile tag call.
Source should have a # before the cffile.

Thirdly, it would help if we could see your CFFILE action=upload call that
actually uploads the file to your server so we can determine what the
filename is going to be, eg as you uploaded it or, uniquely renamed by CF as
part of the upload process.

Paul



~|
Check out the new features and enhancements in the
latest product release - download the What's New PDF now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291446
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: File disappears after cffile rename

2007-10-18 Thread Rick Faircloth
Hi, Michael...

I've used cffile many times to upload documents,
but never to rename them, so I'm speaking from
a lack of experience.

However, looking at the documentation, I see that the
source is a full local system path with the filename,
and the destination is also a full local system path,
including the new name of the file.

While the paths can be absolute or relative, it seems
from your code below that neither the source nor the
destination is a path.

Also, you might try putting

cfoutput#PAGE_clean_SERVERFILE#/cfoutput
cfabort

after the cfset statement to make sure your file renaming
to eliminate spaces is producing the desired name.

One last thing...I just noticed that you've got only 1 #
around cffile.SERVERFILE in your cffile statement.  Is that
in your source, also?

Rick


 -Original Message-
 From: Michael E. Carluen [mailto:[EMAIL PROTECTED]
 Sent: Thursday, October 18, 2007 1:01 PM
 To: CF-Talk
 Subject: RE: File disappears after cffile rename
 
 I am still trying to wrangle this issue.
 
 
 
 cflock name=#CreateUUID()# type=exclusive timeout=30
 throwontimeout=no
 
 cfset PAGE_clean_SERVERFILE = replace(cffile.SERVERFILE,
 ,_,all)
 
 
 cffile action=RENAME source=cffile.SERVERFILE#
 destination=#PAGE_clean_SERVERFILE#
 
 /cflock
 
 
 
 Since this is an avi file being uploaded on a fairly new server, does
 my
 MIME registration on IIS have anything to do with the cffile rename
 anomaly?
 I currently have it for video/avi.
 
 
 
 Any other ideas for me to check for, will help.
 
 
 
 Thanks,
 
 
 
 Michael
 
 
 
 
 
  -Original Message-
 
  From: Michael E. Carluen [mailto:[EMAIL PROTECTED]
 
  Sent: Thursday, October 18, 2007 3:09 AM
 
  To: CF-Talk
 
  Subject: File disappears after cffile rename
 
 
 
  Has anyone experienced having a file literally disappear after a
 cffile
 
  action=rename ?
 
 
 
 
 
 
 
  This happens on CF8. but code works fine on 7.0.2.
 
 
 
 
 
 
 
  Any ideas?
 
 
 
 
 
 
 
 
 
 

~|
Create robust enterprise, web RIAs.
Upgrade to ColdFusion 8 and integrate with Adobe Flex
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291448
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: File disappears after cffile rename

2007-10-18 Thread Michael E. Carluen
Issue solved. (Or perhaps a CF8 bug)

On:

cfset PAGE_clean_SERVERFILE = replace(cffile.SERVERFILE, ,_,all)
cffile action=RENAME source=#cffile.SERVERFILE#
destination=#PAGE_clean_SERVERFILE#

Apparently on CF8, if the cffile.serverfile name and the newly assigned name
var are the same, the file will get deleted when it fires the cffile rename.
To fix it, I wrote a compare() between the 2 names: if its different, on
then will it execute the cffile rename.

I didn't have to do this on CF7 and below.

Hth someone else in the future.

Michael




 -Original Message-
 From: Michael E. Carluen [mailto:[EMAIL PROTECTED]
 Sent: Thursday, October 18, 2007 10:01 AM
 To: CF-Talk
 Subject: RE: File disappears after cffile rename
 
 I am still trying to wrangle this issue.
 
 
 
 cflock name=#CreateUUID()# type=exclusive timeout=30
 throwontimeout=no
 
 cfset PAGE_clean_SERVERFILE = replace(cffile.SERVERFILE, ,_,all)
 
 
 cffile action=RENAME source=cffile.SERVERFILE#
 destination=#PAGE_clean_SERVERFILE#
 
 /cflock
 
 
 
 Since this is an avi file being uploaded on a fairly new server, does my
 MIME registration on IIS have anything to do with the cffile rename
 anomaly?
 I currently have it for video/avi.
 
 
 
 Any other ideas for me to check for, will help.
 
 
 
 Thanks,
 
 
 
 Michael
 
 
 
 
 
  -Original Message-
 
  From: Michael E. Carluen [mailto:[EMAIL PROTECTED]
 
  Sent: Thursday, October 18, 2007 3:09 AM
 
  To: CF-Talk
 
  Subject: File disappears after cffile rename
 
 
 
  Has anyone experienced having a file literally disappear after a cffile
 
  action=rename ?
 
 
 
 
 
 
 
  This happens on CF8. but code works fine on 7.0.2.
 
 
 
 
 
 
 
  Any ideas?
 
 
 
 
 
 
 
 
 
 

~|
ColdFusion 8 - Build next generation apps
today, with easy PDF and Ajax features - download now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291450
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: File disappears after cffile rename

2007-10-18 Thread Michael E. Carluen
@ Paul, Rick, and Brad: Thanks a bunch for your comments, ideas,
suggestions.

The reason why I had the cflock was because directly after the cffile
rename, was a cfexecute for ffmpeg.  Without the lock, it seemed that ffmpeg
begins to execute even before the actual file rename on the file system
completes.  Ffmpeg then throws an error because it does not allow file names
with spaces. You're talking milliseconds of overlap here- unsure if its
caused by the server OS latency but as far as CF goes, I think it thinks has
completed rename.  It doesn't seem to happen all the time, but I did see it
happen.  The lock just seemed to prevent that from happening.


 -Original Message-
 From: Michael E. Carluen [mailto:[EMAIL PROTECTED]
 Sent: Thursday, October 18, 2007 11:11 AM
 To: CF-Talk
 Subject: RE: File disappears after cffile rename
 
 Issue solved. (Or perhaps a CF8 bug)
 
 On:
 
 cfset PAGE_clean_SERVERFILE = replace(cffile.SERVERFILE, ,_,all)
 cffile action=RENAME source=#cffile.SERVERFILE#
 destination=#PAGE_clean_SERVERFILE#
 
 Apparently on CF8, if the cffile.serverfile name and the newly assigned
 name
 var are the same, the file will get deleted when it fires the cffile
 rename.
 To fix it, I wrote a compare() between the 2 names: if its different, on
 then will it execute the cffile rename.
 
 I didn't have to do this on CF7 and below.
 
 Hth someone else in the future.
 
 Michael
 


~|
Enterprise web applications, build robust, secure 
scalable apps today - Try it now ColdFusion Today
ColdFusion 8 beta - Build next generation apps

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291459
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: File disappears after cffile rename

2007-10-18 Thread Michael E. Carluen
Claude, I am sure you (et al) are right on the use(lessness) of locks in
this case.  As I said, I used it with uncertainty thinking (hoping?) that it
was preventing an overlapping of execution between the file rename and
cfexecute.

In other blog threads, I found quite a number of posts about cffile and
ffmpeg, and how both can co-exists but don't really sync well together.

Circling back to the original cffile renaming-disappearing issue, at least
that is resolved.



 -Original Message-
 From: Claude Schneegans [mailto:[EMAIL PROTECTED]
 Sent: Thursday, October 18, 2007 3:19 PM
 To: CF-Talk
 Subject: Re: File disappears after cffile rename
 
  The lock just seemed to prevent that from happening.
 
 If it did, it cannot be for any logical reason.
 The purpose of named locks is to ensure that a program cannot lock under
 the name,
 if another lock with the same name is already active.
 Using CreateUUID() to create a unique name, you just make sure that no
 other
 program, not even another instance of the same template, will never try
 to compete
 this lock. So your lock is completely useless.
 
 --
 ___
 REUSE CODE! Use custom tags;
 See http://www.contentbox.com/claude/customtags/tagstore.cfm
 (Please send any spam to this address: [EMAIL PROTECTED])
 Thanks.
 
 
 

~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291485
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: File disappears after cffile rename

2007-10-18 Thread Claude Schneegans
 The lock just seemed to prevent that from happening.

If it did, it cannot be for any logical reason.
The purpose of named locks is to ensure that a program cannot lock under 
the name,
if another lock with the same name is already active.
Using CreateUUID() to create a unique name, you just make sure that no other
program, not even another instance of the same template, will never try 
to compete
this lock. So your lock is completely useless.

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


~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291481
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4