El mié, 07-12-2005 a las 17:13 +0100, Anne Milbert escribió: > Hi anyone, > > I'd like to delete a file with a servlet. I tried it with the delete() > function and with the runtime.exec() function. What am I doing wrong? > > Here's my code: > Solution 1: > [...] > String cmd = "del C:\\" + request.getParameter("Id") + "-" + eleno + ".xml"; > Runtime runtime = Runtime.getRuntime(); > Process process = runtime.exec(datname) > [...] > > Solution 2: > [...] > String datname = "C:\\" + request.getParameter("Id") + "-" + eleno + ".xml"; > boolean success = (new File("datname")).delete();
Are you kidding??? Remove the quotes to new File("datname"). Mauricio --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]