Help me find the mistake,please!

Hi,
The code is like this:
//delete file
File file=new File(path+name);
if (file.exists()){
     file.delete();}
Now I can print path+name correctly,but I cannot delete the corresponding file from the disk.Help me solve the problem,please.
Thanks in advance.
bao-intoo

Hello,
Probabaly still something wrong with your path.
use :   String curDir = System.getProperty("user.dir");to get the current default system directory first, then append
the necessary directories to your "pathname" variable.
Good Luck !
Rachel

Similar Messages

  • Why doesn't my iPhone 4 have an 'Internet tethering' options? Is it carrier related or iOs related? Please help me find the solution for this. thanx

    Why doesn't my iPhone 4 have an 'Internet tethering' options? Is it carrier related or iOs related? Please help me find the solution for this. thanx

    Personal Hot spot
    http://support.apple.com/kb/HT3574
    Understanding
    http://support.apple.com/kb/HT4517
    Trouble Shooting
    http://support.apple.com/kb/TS2756

  • Please help me find the error in the annex VI,access

    Hello, everyone, this is a program about ACCESS, please help me find the error in the annex VI, why do I always run time error. Thank you very much.
    Attachments:
    write access test.vi ‏22 KB

    Thank you for your reply, I have an attachment process map, could you help me change it, I just want to put my number in the array can continue to update the database. And I want to create a table.
    this is my msn :[email protected]
    Waiting for your reply on line
    谢谢你的回复,我的附件中有程序图,能不能帮我改一下,我只是希望,把我的数组中的数能够持续的更新在数据库中。并且创建一个我想要的表。

  • Help me find my ipod please

    i lost my ipod touch in my friend's dad's car or in my room.. i looked everywhere in my room.. nd my friend say her dat looked in the car and didnt see it, bt i dont kno how thoroughly he looked but i kno its either in his car or in my room, because the last place i had was in his car. I have the app Text Me on my ipod can that in any way help me find my ipod because, the wifi on my ipod is turned off, and i dont have other apps or anything to help me find it.. please help because my mom bought me that for christmas and its was very expensive.

    With wifi off all you can do is look for it like a lost glove. Sorry.

  • I don't find the mistake :(

    i simply don't find the mistake in that code. it's supposed to browse through a folder you specify and then print out all the files, folders (+ the files in there etc.) into a text file (txt or doc). the output in the eclipse console is correct, but the output to the file is not. if i want to write it to a file (txt or doc) it only browses/writes the top level files and folders. contents of subfolders are not witten into the file? so apparently the recursion doesn't work when i write into a file. but why is that?! below my code...
    void browseFolder(String s){
              File destination = new File(s);
              String entries[] = destination.list();
              int i=0;
              try{
                   File textfile = new File(s+"/file.doc");
                   FileWriter writefile = new FileWriter(textfile);
                   BufferedWriter textbuffer = new BufferedWriter(writefile);
                   if (destination.isDirectory()){     
                        while (i<entries.length){
                             File destinationUnterfile = new File(s+"/"+entries);
                             if (destinationUnterfile.isDirectory()){
                                  //to file
                                  textbuffer.write(s+"/"+entries[i]);
                                  textbuffer.newLine();
                                  textbuffer.write("--------------------------------------");
                                  textbuffer.newLine();
                                  textbuffer.newLine();
                                  //to console
                                  System.out.println(" ");
                                  System.out.println(" ");
                                  System.out.println(s+"/"+entries[i]);
                                  System.out.println("--------------------------------------");
                                  browseFolder(s+"/"+entries[i]);
                             }else{
                                  //to file
                                  textbuffer.write("- "+entries[i]);
                                  textbuffer.newLine();
                                  textbuffer.newLine();
                                  //to console
                                  System.out.println("- "+entries[i]);
                             }//end if/else
                             i++;
                        }//end while
                        textbuffer.close();
                   }else{
                        System.out.println("Please specify a folder to browse.");
                   }//end if/else
              }//end try
              catch (IOException e){
                   System.out.println("Error -- " + e.toString());
              }//end catch
         }//end browseFolder

    hm, does it work if i insert a timestamp into the filename? if tried it like that, but it still doesn't work!
    void browseFolder(String s){
              File destination = new File(s);
              String entries[] = destination.list();
              int i=0;
              try{
                   Date dt = new Date();
                   File textfile = new File(s+"\\file"+dt.getTime()+".doc");
                   System.out.println(s+"\\file"+dt.getTime()+".doc");
                   FileWriter writefile = new FileWriter(textfile);
                   BufferedWriter textbuffer = new BufferedWriter(writefile);
                   if (destination.isDirectory()){     
                        while (i<entries.length){
                             //File destinationUnterfile = s+entries;
                             File destinationUnterfile = new File(s+"\\"+entries[i]);
                             if (destinationUnterfile.isDirectory()){
                                  //to file
                                  textbuffer.write(s+"\\"+entries[i]);
                                  textbuffer.newLine();
                                  textbuffer.write("--------------------------------------");
                                  textbuffer.newLine();
                                  textbuffer.newLine();
                                  //to console
                                  System.out.println(" ");
                                  System.out.println(" ");
                                  System.out.println(s+"\\"+entries[i]);
                                  System.out.println("--------------------------------------");
                                  System.out.println(s+"\\"+entries[i]);
                                  browseFolder(s+"\\"+entries[i]);
                             }else{
                                  //to file
                                  textbuffer.write("- "+entries[i]);
                                  textbuffer.newLine();
                                  textbuffer.newLine();
                                  //to console
                                  System.out.println("- "+entries[i]);
                             }//end if/else
                             i++;
                        }//end while
                        textbuffer.close();
                   }else{
                        System.out.println("Please specify a folder to browse.");
                   }//end if/else
              }//end try
              catch (IOException e){
                   System.out.println("Error -- " + e.toString());
              }//end catch
         }//end browseFolder

  • I need help to find the serial number for Photoshop Elements 11

    Hi! I need help to find the serial number for Photoshop Elements 11 I downloaded last year on Apple Application Store.. I have been using photoshop on mac for over a year and now need the serial number to be able to use it on macbook. I looked up Adobe's website for help but found none and noone to ask for support.. Any ideas how I can get the serial number using the App Sore bill I have?

    Please post Photoshop Elements related queries over at
    http://forums.adobe.com/community/photoshop_elements

  • Can someone help me find the JavaMail example code?

    Hello, once I found a collection of source code files that contained example code for using the JavaMail API. Now I cannot find the collection. Is it still online? Can anyone help me find the JavaMail example code? Sorry if this question seems to easy - I've been searching for a while now without success.
    Thanks in advance,
    Paul Humphrey

    Really? You can't find it? My answer above wasn't
    clear? And this FAQ entry didn't help?
    http://java.sun.com/products/javamail/FAQ.html#examples
    Please, tell me how I could make the answer more clear to you...

  • Help me find the download link [SB0570 ]

    Please help me. I see that my Audigy SE [Model NO. SB0570 ] is listed in win7 driver availability list but everytime I go to the support homepage for Audugy SE http://support.creative.com/Products...ctDetails.aspx I don't see any driver download option. Please help me find the download link for the driver for Win 7 64-BIT os.
    Please!

    Hello LastBOSS,
    Get it here. Welcome on board!

  • I have bought 12 songs from iTunes on my I phone and would now like to record them on a CD.  When I open my Itunes on my desktop and go to what I've purchased it shows only 7 songs bought????  Can anyone help me find the other's so I can burn a CD?

    I have an IPhone 4 and downloaded 12 songs from the Itunes store on my phone.  I want to burn a CD but when I go into my ITunes on my desktop which is Windows XP there are only 7 listed not the 12 I bought.  Can anyone help me find the others?????

    Connect iPhone, then go to iTunes > File > Transfer purchases...

  • Hi.I need help.my iphone was Stolen .how can I get back my iphone. Serial No.DX*****PMW.could you help me find my iphone.thank you very much.could you send me the ICCID number to help me find the iphone

    Hi.I need help.my iphone was Stolen .how can I get back my iphone.  Serial No.DX******PMW.could you help me find my iphone.thank you very much.could you send me the ICCID number to help me find the iphone.if you can help me.
    <Personal Information Edited by Host>
                                                                                                                                                                   Sincerely a Chinese girl really need your help

    Sorry we are all users on this User  Community No Apple Staff
    Read this .
    http://support.apple.com/kb/HT2526
    Apple do not and cannot assist in finding stolen property ,that is the responsility of your Police

  • Can anyone help me find the output option in Bridge CC?

    Can anyone help me find the output option in Bridge CC?

    http://helpx.adobe.com/bridge/kb/install-output-module-bridge-cc.html

  • Need help in finding the number of occurrences of a pattern.

    Hi All,
    I need help in finding the number of occurrences of a pattern in a table's column's data.
    Consider sample data - one row's column from a table:
    "S-S-S-A-S-S-P-S-S-B-S-A-P-S-S-C"
    My requirement is:
    I should get the count of S's which are immediately preceded by A or P.
    for the above data i should get count as 3+2+1=6 (S-S-S-A, S-S-P, S-A)
    The pattern data is stored as VARCHAR2 type.
    Thanks in advance,
    Girish G
    Edited by: Girish G on Jul 21, 2011 11:22 PM

    I am sure there exists a better way then this one:
    SQL> with dt as
      2  (select 'S-S-S-A-S-S-P-S-S-B-S-A-P-S-S-C' str from dual)
      3  SELECT SUM(Regexp_count(Regexp_substr(str, '(S\-?)+(A|P)+', 1,
      4                                     Regexp_count(str, '(S\-?)+(A|P)+') - (
      5                                                  LEVEL - 1 )), 'S')) len
      6  FROM   dt
      7  CONNECT BY LEVEL <= Regexp_count(str, '(S\-?)+(A|P)+')
      8  /
           LEN
             6

  • Hello please I want the solution I have in my iTunes I own $ 112 and you purchase from the game of war gold price of gold and 99.99 discount iTunes money did not come in the gold game of war and that I am two days ago, I did not find the solution please I

    Hello please I want the solution I have in my iTunes I own $ 112 and you purchase from the game of war gold price of gold and 99.99 discount iTunes money did not come in the gold game of war and that I am two days ago, I did not find the solution please I want the solution quickly

    Go here:
    http://www.apple.com/support/itunes/contact/
    and follow the instructions to report the issue to the iTunes Store.
    Regards.

  • Can't get iphone to recognize itunes on my computer. do i have to use the original cord to connect? i can't find the cord. please advise.

    Can't get iphone to recognize itunes on my computer. do i have to use the original cord to connect? i can't find the cord. please advise.

    Do you mean that iTunes doesn't recognize your phone when you plug it into your computer using the usb to dock cable?  If so, see http://support.apple.com/kb/TS1538.  (And yes, you need to use the usb to dock cable that came with your phone.  If you dont' have it you'll have to buy another one.)

  • HT5568 when i try to install the Safari 6.0.2 update i get the message an error has occured The operation couldn't be completed. (NSURLErrorDomain error -3001.)(102) - can anyone help my get the update please

    when I try to install this update I get the message an error has occured The operation couldn’t be completed. (NSURLErrorDomain error -3001.)(102) - can anyone help my get the update please?

    There are problems with the servers. Download and install that update > http://swcdn.apple.com/content/downloads/53/02/041-8081/2jwp4wjrwygtm4lc608qy4h0 n4a9yyq37g/Safari6.0.2Mountain.pkg

Maybe you are looking for

  • INDEX vs TABIX

    Hi, Can some body explain the CLEAR difference between Sy-index and Sy-tabix. And one or two small examples. I am little bit confused. Thanx.

  • Making video in Mac Air. Get shhhh sound from fan. Help

    Making video using iMovie and/or FaceTime with built in camera. Fan turns on and video record and play sound of fan. Problem remains with external mic. I am a college prof and hypnotherapist. Quality of voice recording is very important. Van't mask w

  • Roman numerals

    can anyone help me out with a Java program that promts for a number and displays it in a roman numerals please help!!!

  • How can I order a iPad 3 16gb wifi only?

    How can I order a white iPad 3 16gb wifi only??

  • Load different xml structure in single flash file

    Hi to all, How can i call different xml structures in single file.. actually i am looking for 2 different menu galleries in single file.. first menu contains.. some 4 to 5 buttons.. done with this.. in other flash file..having some of 4-5 buttons.. a