Unable to delete a file

I'm unable to delete a a file from the filesystem.
String fileName = "dummy.xml"
boolean delete = (new File(fileName)).delete();It's not deleting this file from the filesystem.

Can anything else delete that file? Is the fileopen?
I don't know what you mean by can anything else
delete the file.I mean can you delete the file from the command line, a window, whatever. Is it just Java's delete that is having this problem or is it the file system?
No this is not opened/or use.How do you know?
DO I have to specify a path for this. Certainly. How else would Java know which file to delete?
If yes, please read on ........
the path where this xml file resides could by
anywhere in the file system. If it is how do I access
it since there is no specific location (it is left to
the user's choise to save the file anywhere he
wants)Keep the user's choice.

Similar Messages

  • Unable to delete a file on application server

    Hello Experts,
    I have gone through  couple of post and sample nothing worked that's the reason Iam posting a query here.
    Please help me with your valuable suggestions.
    I am reading a file from the application server running a BDC program to update my ztable all works fine.
    now i wanted to move this file to another folder thats too working perfectly but now when i try deleting the older one it is not getting deleted.
    I have closed the dataset and checked the authorization that is not a concern but still it is not getting deleted.
    I have pasted the code below.
    For READ and CLOSE dataset it returns subrc as 0 but after delete it returns 4.
    data : mess type string.
    OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT message mess.
    IF SY-SUBRC = 0.
    DO.
        READ DATASET ld_file INTO wa_string.
        if sy-subrc eq 0.
            append wa_string to it_string.
            clear wa_string.
        else.
            exit.
        endif.
      enddo.
      close dataset ld_file.
      delete dataset ld_file.
    else.
    WRITE 'Unable to open source file to move the content'.
    endif.
    Regards,
    Ranjith N

    Hello Mr Ghode,
    Thaking you for your response on my query.
    as you said to handle exception this is what i have done.
    kindly verify the same would be of great help.
    still iam unable to delete the file.  
    OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF SY-SUBRC = 0.
        DO.
          READ DATASET ld_file INTO wa_string.        "LV_LINE is variable to hold line contents being read
          if sy-subrc eq 0.
            append wa_string to it_string.
            clear wa_string.
          else.
            exit.
          endif.
      enddo.
      close dataset ld_file.
      if sy-subrc eq 0.
      try.
        delete dataset ld_file.
        catch CX_dynamic_check into t_ref.
        err_txt = t_ref->get_longtext( ).
    endtry.
    endif.
    endif.
    Regards,
    Ranjith N

  • Unable to delete the file. (Some times deletes and sometime fails to delet)

    Please help me in deleting the file from the temporary location .
    Below is my code
    //Append the session is with filename as there is possibility of having same name of file.
    try{
    boolean isMultipart     = ServletFileUpload.isMultipartContent(request);
              if (isMultipart)
                   // Create a factory for disk-based file items
                   factory = new DiskFileItemFactory();
                            // Create a new file upload handler
                   upload = new ServletFileUpload(factory);
                   // Parse the request
                      List /* FileItem */ items = upload.parseRequest(request);
                           // Process the uploaded items
                   Iterator iter = items.iterator();
    if(strInputFileName.lastIndexOf("\\")== -1)
         strInputFileName = (String)mPropBag.get("TempUploadDirM") + strInputFileName;
      }else
         strInputFileName = (String)mPropBag.get("TempUploadDir") +   strInputFileName.substring(strInputFileName.lastIndexOf("\\"));
    strInputFileName = strInputFileName + "_" + request.getSession().getId();
    uploadedFile     = new File(strInputFileName);
    item.write(uploadedFile);  //// I am Writing the file in this location appened with the session Id because there might //be a  possibility of having same name of file.
    catch(......)
    finally
         uploadedFile.delete();
         uploadedFile = null;
         upload = null;
    }I am unable to delete the file from the temporary location
    some times it is deleting and some times it is not deleting.. I have also tried ...deleteOnExit();

    Make sure you've got no other processes holding onto it (Windows Explorer, for instance) and that you've closed any streams involved with the file. If that fails, try calling System.gc() just before deleting the file. This is a workaround for a bug in certain JVMs on Windows machines

  • Unable to delete Acrobat files from PC

    This is a new problem. The Acrobat files cannot be deleted from the Acrobat program, my documents or my downloads files. A popup keeps telling me the files are 'in use' even though no other programs are open. And yes, I've rebooted several times and logged in and out of Adobe CC a few times just to make sure.
    How do I get rid of the *(&&^% files?

    Are these on a network and somehow accessed by other people?
    Are you on a Windows PC and have adminstrator privileges? Because you just might be unable to delete those because the rights have been set somehow. Check the file properties if you have sufficient rights on those files.
    Are there PDF related background tasks and services running which might lock the files?

  • Need Help-SOA 11g File Adapter unable to delete input file and its crashing

    Hi All
    Please find the details below:
    1. We have created a simple SOA composite to Read file from an input directory, archive the file in an archive directory using Inbound File Adapter Read
    and then use Outbound File Adapter Write to move the file to a output directory.
    2. File Adapter needs to delete the file after successful read/retrieval.
    3. We are using the "Use Trigger File" for invoking the file adapter. This is a new feature in SOA 11g
    4. Also we are using the option of reading the file as an attachment as we are not doing any transformation in the composite
    Issue Details_
    1. When the trigger file is put in the input directory for the first time, the File Adapter reads the file, archives it and moves it to the output directory
    2. However it does not delete the input file from the input directory and raises Fatal Exception mentioned below:
    [*2011-01-12T16:55:48.639+05:30] [soa_server1] [WARNING] [] [oracle.soa.adapter] [tid: weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@19c243d]*
    [userId: <anonymous>] [ecid: 0000IptyLrL9_aY5TrL6ic1DBOS_000009,0] [APP: soa-infra] File Adapter FileAdapterTriggerFilePOC PostProcessor::
    Delete failed, the operation will be retried for max of [0] times
    [2011-01-12T16:55:48.639+05:30] [soa_server1] [WARNING] [] [oracle.soa.adapter] [tid: weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@19c243d]
    [userId: <anonymous>] [ecid: 0000IptyLrL9_aY5TrL6ic1DBOS_000009,0] [APP: soa-infra] File Adapter FileAdapterTriggerFilePOC [[
    BINDING.JCA-11042
    File deletion failed.
    File deletion failed.
    File : C:\Dibya\AttachmentTest\InputDir\TestFile3.txt could not be deleted.
    Delete the file and restart server. Contact oracle support if error is not fixable.
    If any one has faced similar issues, kindly provide pointers on how to resolve it.
    Regards,
    Dibya

    Hi,
    Using the file adapter, you can poll from multilple locations...
    Keep the following property in your .jca file
    <property name="DirectorySeparator" value="," />
    While giving the path in File Adapter configuration, keep comma and give the next location....then the file will be picked up from the locations you gave....
    Hope this helps...
    Thanks,
    N

  • Unable to delete a file from the downloads list of...

    i am an e7 user. I was recently downloading a couple of videos at the same time when my phone hanged and had to be restarted. When it did restart, most of the files had to be redownloaded. All except one. The downloads list claims that the file has been saved. The video plays bt isnt completely downloaded.
    The problem now is that i cant delete the video through the file manager. The error msg says web:already in use.. When i tried deleting the file from the downloads list of the web browser, there was a similar msg.
    So how do i remove this file from my phone??
    I tried downloading a couple of file managing softwares bt that didnt really help....
    Solved!
    Go to Solution.

    Retry after clearing the Browser Cache.. If that does not solve.. Reboot the phone and try again...

  • Unable to delete some files

    I have some audio files that appear only in smart lists and not in the library. You can't delete a file from a smart list view (correct me if I'm wrong) so you have to find it in the library to delete it.
    It doesn't appear in the library - so I cannot delete these files.
    I'm not sure how this happened but I have a theory. These all appear to be podcasts. Some are from audible but not all are. I think I may have deleted, or unsubscribed from the podcast in the podcast view but I didn't remove the files first. So it looks like the files are still around but since they are podcasts they don't appear in the library, and since the I'm not subscribed to the podcast they aren't in the podcast list either.
    Is there a way to get rid of these files? I thought of resubscribing to the podcasts but a lot of these I don't even remember what the podcast was.

    You can't delete a file from a smart list view (correct me if I'm wrong)
    Shift Delete.

  • Unable to delete the files from CSV volumes on HyperV Cluster

    Hello There,
    I have a HyperV failover cluster with CSV Volumes recently i moved some of the VMs to another cluster.
    VMs are moved but i still have the VM files on the CSV volumes which are occupying the disk space i tried to delete the VHD files / VM folders which are moved but it doesn't delete the files, please suggest.
    This file when i browse it from  a server and delete the file it disappears but when i revisit the folder i find the files still on the disk, i did try to delete the files directly
    from the server through command line as it is running server core.
    Regards,
    Maqsood
    Maqsood Mohammed Senior Systems Engineer MCITP-Enterprise Admin & ITILv3 Foundation Certified

    HyperV is good about not allowing you to delete files while they are still in use. You can try to reboot host, make sure all parts if your VM moved to the new location. If that VHD is associated with a VM on any host you will not be able to delete
    it. Delete the VM's that may have links to it. Not knowing you configuration could it be a parent disk?  Be carful because if you can't delete it it's likely in use, I've see VHD merge after you delete a VM too preventing you from deleting the files.
    You may just want to wait a day or so and see if it free's up. If it is doing a merge reboot will pause and restart it so you won't be able to remove until the merge is done, once you delete a VM and a merge starts there is no way to tell if it's merging,
    watch the size and timestamp of the VHD is it changing if it is something is using it.

  • Unable to delete undo file at OS level

    Hi Friends,
    Database: 10.2.0.3
    OS: windows 2003 server
    I dropped undo tablespace using
    drop tablespace undotbs1 including contents and datafiles; command.
    but still the files are residing in the drive. when i tried to delete them manually its saying the file is used by another process.
    is there anyway to delete the file without bouncing the database?

    Before Dropping an Undo Tablespace U need to switch to an another Undo tablespace
    like
    SQL> create undo tablespace undotbs2 datafile ‘/u01/oradata/decipher/undotbs2_01.dbf’ size 1024m autoextend on next 256m maxsize 10240m;
    SQL> alter system set undo_tablespace= UNDOTBS2 scope=both;
    SQL> drop tablespace UNDOTBS1 including contents and datafiles;
    Dropping the old undo tablespace may give ORA-30013 error: undo tablespace ‘%s’ is currently in use. This error indicates that you need to wait for the undo tablespace to become OFFLINE. Initially, on switching to the new UNDO tablespace, the old UNDO tablespace will go into PENDING OFFLINE status until the active incomplete transactions are finished.
    Iam sure ur Datafile will be get dropped ..

  • Unable to delete data files from my Ipod if used as data storage...

    Hello everybody
    I bought months ago an Ipod Nano 8GB. I've got an issue when i use it as disk storage i'm not able to sort out. I've checked all the topics but i cannot find any solution.
    Example: I use the Ipod with the option "Manually manage music and videos". I put audio and video files on my Ipod through Itunes, then i put also some files on my Ipod as normal data files through my Mac Finder (Easy, i drag VLC, JPG files etc. from folders to my Ipod). The Ipod/Itunes summary page shows (Correctly) the capacity column colored in blue (Audio), video (Purple) and orange (Data). No probs when i transfer data files to another computer.
    Problem: when i delete the data files from my Ipod (Through finder) the orange column doesn't disappear (I have no problems if i delete audio/video files via Itunes) and although i've actually deleted all the files if i try to add some other data or videos/music files to my Ipod, Itunes says that there is no space available in my device. It's very strange, i check and double check all the options but eventually i have to restore my Ipod all the times and (Pretty annoying) add all my files again.
    It seems that although i sent my files to the trash bin, Itunes (Fully updated) doesn't recognize the change.
    It'd be great if someone can help me out as it's very important for me to be able to use my Ipod as disk storage, thanks a lot!

    It seems that although i sent my files to the trash bin, Itunes (Fully updated) doesn't recognize the change.
    Empty it from the Finder menu or by control-clicking it in the Dock.
    (44613)

  • Unable to delete some files or empty them from Trash

    Hi, I receive the following message when trying to empty files from the Trash:
    "The Finder cannot complete the operation because some data in "lg550-1.gif" could not be read or written.
    (error code -36)"
    There are hundreds of these .gif files in an images folder which I would like to delete by emptying the trash. Finder is asking whether I would like to continue or stop emptying the trash...I'm wondering if there is a way to eliminate this images folder manually from the command line?
    (I just don't have the time to constantly click upon "continue" and I think these files will still be in the Trash in any case, with the basic problem unsolved so long as they are not permanently deleted.)
    Thanks

    Reading
    [You can't empty the Trash or move a file to the Trash in Mac OS X|http://docs.info.apple.com/article.html?artnum=106272]
    [Solving Trash Problems|http://www.thexlab.com/faqs/trash.html]
    [How To Fix Stubborn Trash and Why it Won't Delete|http://www.osxfaq.com/Tutorials/LearningCenter/HowTo/Trash/index.ws]
    *Utilities for emptying trash problems*
    [Trash It! v3.6.1|http://www.nonamescriptware.com/?page_id=5]
    [DropNuke|http://www.versiontracker.com/dyn/moreinfo/macosx/12664]
    [Super Empty Trash 2.3|http://www.macupdate.com/info.php/id/16727] - Simple AppleScript applet that will empty the Trash with administrator privileges
    [What's Keeping Me|http://www.hamsoftengineering.com/products/wkm/wkm.html] - lists files open and applications that are using them

  • I am unable to delete the files

    Hi all,
    I am totally new with this iPad stuff, so I hope that someone could help me a bit. I bought the software which is called BUZZ Player (plays videos and subtitles). So, I installed the software and upload a few videos (avi's) and subtitle's (.idx and .sub) via iTunes. Then I start the player and everything worked perfectly except I did not see any subtitles.
    Then I decided to remove those files and upload something else. Well, I manage to delete those avi's, but not the subtitles, because BUZZ player does not show them. When I look at the iTunes (My pad -> Apps -> File Sharing -> BUZZ player) those subtitle files are still there, but there's no way to delete them but only upload more stuff.
    So, my question is that is there any way to get rid off those files?
    Oh, I almost forgot to mention that iPad search can not find them either.
    Thanks in advance!

    Hi there eizi, and welcome to apple discussions.
    Just click on one of the files in itunes, and press backspace, or delete on your keyboard. You will receive a warning, and then you can delete.
    I don't see why apple do not put a delete button on there!
    Hope this helps.
    < Edited by Host >

  • 10.1.3.5 - Unable to delete tmp files during bpel redeployment

    when I try to re deploy bpel process, i am getting the following error
    An error occurred while attempting to deploy the BPEL suitcase file "C:\product\10.1.3.1\OracleAS_1\bpel\domains\default\tmp\bpel_2455783.tmp"; the exception reported is: archive cannot rename C:\product\10.1.3.1\OracleAS_1\bpel\domains\default\tmp\.bpel_WorkOrderIn_bpel_1.0_674431f9e04e68ddac78adf0281872dd.tmp
    it looks the directory is in use and the only way i can delete it is stopping the server and deleting it.
    Anyway to fix this ?

    same problem is discussed here :
    http://blog.thisisahmed.com/2009/10/bug-in-soa-suite-10g-10135-patchset-for.html
    http://www.ibiztrack.com/forums/bpel/msg/14.html
    http://kr.forums.oracle.com/forums/thread.jspa?threadID=957142
    guess you're not the only one, and for as far as i can see it's a bug without a fix yet.

  • Unable to delete corrupted files on music player o...

    guys please help me to delete the corrupted files in music player (album)
    Hard and Soft Reset doesn't work, the files are still there 
    help me guys.. tnx

    Seen these?
    User Contributed Tips:
    Pondini - Time Machine - TROUBLESHOOTING (Sept 25, 2009)
    http://discussions.apple.com/thread.jspa?threadID=2057525
    Pondini - Time Machine -- Frequently Asked Questions (Apr 3, 2009)
    http://discussions.apple.com/thread.jspa?threadID=1964018

  • Unable to delete file from trash because it's "in use" not locked.

    I'm unable to delete a file from trash. I keep getting the following message: "The operation can’t be completed because the item is in use."  I've confirmed the file isn't locked and I've tried renaming it but still no luck. I'm running OSX 10.8.4. Any thoughts?

    Check the 'More Like This' discussions on the right hand column.  I suspect you may find the answer there.
    Ciao.

Maybe you are looking for

  • Why do i see a yield symbol with an exclamation mark in final cut pro 7.

    Why when editing in Final Cut Pro 7 do I see a yellow triangle with an exclamation mark in it when stopped.  I sometimes see a gree check mark and am wondering the differnce and how to adjust?

  • Shared members and consolidation processes

    Hi guys, I'm working giving support to a HFM application and I need some advice, since I'm a little confused. I have 4 different chart of entities: 1) ComConsol 2) Legal 3) BGroups 4) Alternate I was trying to lock the data of ComConsol in a grid whe

  • Tab Canvas : 1 data block 2 different query for each tab) Forms 10g

    Hello allllll, I have 2 blocks Master datail ,the master is non-db the tab canvas is for one data block: Problem 1: How 2 display same data block in each tab.? Problem 2: How when pressing excute Query button each tab display the data ---------------

  • I can't find my backup through itunes

    hi I work mainly on a PC. I back up periodically my iphone on my computer.  I know where to find my backups.  Recently my phone crashed and needed restoring, I go to choose my backup and the one I want is not there.  I know where to find the backups

  • Recommendations for optimal QuickTime HD export settings?

    I've searched and didn't see anyting specific to my question, however my apologies if this is a repeat question. I frequently have to export 1080p, 1080i and 720p @29.97 QuickTime files from CS5 and no matter what settings I've used I always seem to