#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2011
    Posts
    60
    Rep Power
    4

    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
  2. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,265
    Rep Power
    968
    Can you explain what you mean by "close a file"?
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2011
    Posts
    60
    Rep Power
    4
    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
  6. #4
  7. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,265
    Rep Power
    968
    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)?
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2011
    Posts
    60
    Rep Power
    4
    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..?
  10. #6
  11. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,265
    Rep Power
    968
    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?
  12. #7
  13. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,265
    Rep Power
    968
    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.
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2011
    Posts
    60
    Rep Power
    4
    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.

IMN logo majestic logo threadwatch logo seochat tools logo