Link to home
Start Free TrialLog in
Avatar of Maranellas
Maranellas

asked on

How to detect if directory is writible in JAVA

As the topic says.
Avatar of Artic
Artic
Flag of United Kingdom of Great Britain and Northern Ireland image

File f = new File("C://Documents and Settings//All Users//Documents");
    if(f.canWrite())
        System.out.println("The directory is writable");
    else
        System.out.println("The directory is not writable");
Avatar of Maranellas
Maranellas

ASKER

isn't it suppose to be backslash .forward slash is for unix systems only
You can use:

File.separator

The system-dependent default name-separator character.
yes i already aware of that the thing is he gave incorrect solution apparently!
ASKER CERTIFIED SOLUTION
Avatar of eitama
eitama

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial