The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages - More
> ColdFusion Development
|
CF MX 7 close file
Discuss CF MX 7 close file in the ColdFusion Development forum on Dev Shed. CF MX 7 close file ColdFusion Development forum discussing CFML coding practices, tips on CFML, and other CFML related topics. Find out why ColdFusion is the tool of choice for many e-commerce developers.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

November 29th, 2011, 10:42 AM
|
|
Contributing User
|
|
Join Date: Jun 2011
Posts: 60
Time spent in forums: 13 h 22 m 2 sec
Reputation Power: 2
|
|
|
CF MX 7 close file
Hi Peers,
i am wondering if there is a way to close a file in CF MX 7 .
i tried to google that but seems this function does not exist in CF MX 7 and i really want that close file as i have to wait for more than 3 min to delete my file
thanks
|

November 29th, 2011, 03:48 PM
|
|
Moderator
|
|
Join Date: Jun 2002
Location: Raleigh, NC
|
|
|
Can you explain what you mean by "close a file"?
|

November 29th, 2011, 04:35 PM
|
|
Contributing User
|
|
Join Date: Jun 2011
Posts: 60
Time spent in forums: 13 h 22 m 2 sec
Reputation Power: 2
|
|
Quote: | Originally Posted by kiteless Can you explain what you mean by "close a file"? |
hi there ,
I need to close a file that is actually used by other program.
iam initially loading that xls file..and after using it i have to delete it from my temp folder.. The issue is when users load some corrupted files , i have to wait 2 min to be able to delete that file.
since that file is still open , i want to be able to close it and then delete it without waiting 2 min.
thanks
|

November 29th, 2011, 04:52 PM
|
|
Moderator
|
|
Join Date: Jun 2002
Location: Raleigh, NC
|
|
|
I'm still not following. If it's a file system issue lock, then CF can't do anything with the file until the lock at the file system level is released. What is locking the file and keeping it open? Is someone actually OPENING the file in some other program (like Excel)?
|

November 29th, 2011, 05:14 PM
|
|
Contributing User
|
|
Join Date: Jun 2011
Posts: 60
Time spent in forums: 13 h 22 m 2 sec
Reputation Power: 2
|
|
Quote: | Originally Posted by kiteless I'm still not following. If it's a file system issue lock, then CF can't do anything with the file until the lock at the file system level is released. What is locking the file and keeping it open? Is someone actually OPENING the file in some other program (like Excel)? |
No, basically users try to load a corrupted xls 2003 file ..basicalkly they just save a 2007 as 2003 and try to load it as 2003. the converted file will not be proceeded and consequently enter in a loop for a 1-2 min...which means the file is open..
Iam trying to close the file 1st before deleting it...
My need is ,,is there a way to close a file in CF 7 as i could not find any information in livedocs about something like <cffile action="close" ...ie
not sure if it is clear..?
|

November 29th, 2011, 09:08 PM
|
|
Moderator
|
|
Join Date: Jun 2002
Location: Raleigh, NC
|
|
|
No, sorry, its still not clear. A file is just binary data. Neither ColdFusion nor the operating system know or care if it is an Excel 2003 or 2007 file. That only matters to Microsoft Excel.
I think you're still not explaining some part of what is going on. When you say the user "saves it as 2003" and then "loads it as 2007", what does that mean? Does "save" mean UPLOADING this file to the server using CFFILE? Does "load" mean DOWNLOADING this file? Or does "save" mean actually saving the file from Excel to the hard drive on the server? And "load" mean opening the file in Excel from the hard drive on the server?
|

November 29th, 2011, 09:11 PM
|
|
Moderator
|
|
Join Date: Jun 2002
Location: Raleigh, NC
|
|
|
Also, to be clear, if the USER is opening the file and creating the lock, then no, CF can't delete the file. The whole point of a lock on a file is to stop anything else from doing something to the file.
You *might* be able to force delete it by running a command line delete, but I think that would require System Admin permissions which is a very dangerous thing to assign to web-based processes.
Last edited by kiteless : November 29th, 2011 at 09:14 PM.
|

November 30th, 2011, 07:20 AM
|
|
Contributing User
|
|
Join Date: Jun 2011
Posts: 60
Time spent in forums: 13 h 22 m 2 sec
Reputation Power: 2
|
|
Quote: | Originally Posted by kiteless Also, to be clear, if the USER is opening the file and creating the lock, then no, CF can't delete the file. The whole point of a lock on a file is to stop anything else from doing something to the file.
You *might* be able to force delete it by running a command line delete, but I think that would require System Admin permissions which is a very dangerous thing to assign to web-based processes. |
ok i got it
Thanks kiteless.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|