File.separator() returns the symbol for the platform. -----Original Message----- From: A mailing list for discussion about Sun Microsystem's Java Servlet API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Bourke, Jenny J SITI-ISEA Sent: Friday, October 05, 2001 4:39 PM To: [EMAIL PROTECTED] Subject: Re: Deleting files from a servlet
Use the Windows path separator \ -----Original Message----- From: Sohaila Roberts [mailto:[EMAIL PROTECTED]] Sent: Friday, October 05, 2001 4:29 PM To: [EMAIL PROTECTED] Subject: Deleting files from a servlet Hello, I have a servlet that deletes a file from the server that the servlet runs on. The servlet is called from an applet. When I run this function on a linux box everything works fine and the file is deleted from the server and db entries relation to where the file is and its id are deleted. But when I run this from a window's box (windows 98 to be specific) with either IE5.5 or Netsape 4.75 the file is not deleted from the server but the database cmds are preformed fine. The code i'm using to delete the file from the server in my servlet is if(new File("/tmp/"+data.getFileName()).delete()) { out.writeObject("File Deleted"); } else { out.writeObject("File Not Deleted"); } Is there anything specific to do to make this code work on windows? Thanks Sohaila ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
