On 5/6/05, Joe Hertz <[EMAIL PROTECTED]> wrote: > I have a Struts Servlet that executes the code snippet below to create a > directory. > > Under Windows, this works great, the directory showing up under > C:\TOMCAT4\WEBAPPS\ > > Under Suze Linux, it doesn't get created, and it's not a permission problem. > At least not under the webapps directory. The Tomcat user can definitely > create a directory there (I've su'd to him and done it). > > What should I be looking at next? > > > String filePath = File.separator + userId; > > File dirs = new File(File.separator + > rs.getMessage("imageFilePath") + filePath); > > dirs = new File(File.separator + rs.getMessage("imageFilePath") + > filePath); > > > > if (!dirs.exists()) > > { > > dirs.mkdirs(); > > } > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
you tried to debug it. You can check what is the path before the directory is created. In Linux / means the root directory and since the path name begins with File.separator(/), the file is created with reference to /. For eg. if filePath is /anto. Then if Tomcat have write permission to root directory the directory will be created. -- rgds Anto Paul --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]