w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Folder and file are not getting created by Java code under Linux, but it works for Windows

You can use the static field File.separator or, better, use the nio Paths class like this:

File f = Paths.get( "dir1", "dir2", "dir3" ).toFile();

To get something to refer to the absolute path, start the String arguments with a File.separator, which you might get also with nio with this method:

http://docs.oracle.com/javase/7/docs/api/java/nio/file/FileSystem.html#getSeparator%28%29





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.