Thursday, February 20, 2014

File file = new File of BUG


 
String str = "mnt/sd/mkl/pic2";
str = new String (str.getBytes ("8859_1"), "GB2312") ;/ / 8859_1
File desFile = new File (str);
if (desFile.isDirectory ())
{
/ / This is not executed
if (! desFile.exists ())
{DesFile.mkdir ();}
continue;
}
if (desFile.isFile ())
{
/ / Actually perform here
}
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
mnt/sd/mkl/pic2 This may not be the directory, so I can not perform.

Reply:
desFile.mkdir (); This sentence execution yet
Reply:
cited a floor birdsaction reply:
mnt/sd/mkl/pic2 this probably is not a directory, so I can not perform.

There may be, there is a continue below
Reply:
str = new String (str.getBytes ("8859_1"), "GB2312") ;/ / 8859_1
This code system seems to mystify
Does the file name have to GBK code system?
Reply:
str = new String (str.getBytes ("8859_1"), "GB2312") ;/ / 8859_1
This code system may be a problem,
There are "GB2312" said the meaning of the original bytecode is GB2312 (right), converted to 8859_1;
Reply:
String str = "mnt/sd/mkl/pic2";
File desFile = new File (str);
if (desFile.isDirectory ())
{
if (! desFile.exists ())
{DesFile.mkdir ();
}
/ / Continue;
}
if (desFile.isFile ())
{
/ / Actually perform here
}

No comments:

Post a Comment