views:

123

answers:

0

Hi,

We're switching to commons for our file IO.

But when i try to write a string to a file where the directory doesn't exist it gets a FNF exception. Pretty right you think. Javadoc says:

public static void writeStringToFile(File file,
                                     String data,
                                     String encoding)
                              throws IOException

Writes a String to a file creating the file if it does not exist. NOTE: As from v1.3, the parent directories of the file will be created if they do not exist.

Ok there must be something wrong since i expected the dir to be created. I was writing to c:/temp/test where c:/temp exist. When i create subfolder test manually it just works.

Is this a bug?