I’m trying to port some code from Linux to Windows. I really don’t know much about Windows, and so I’m kind of flying blind. The code in question attempts to delete some directories using org.apache.commons.io.FileUtils
// If the mergesegs worked, delete the segment dirs
for (File file : segments.listFiles())
{
if (!file.equals(mergedSegFile))
{
LOG.debug("deleting segment dir " + file);
FileUtils.deleteDirectory(file);
}
}
segments is a File, as is mergedSegFile. It dies with an IOException "Unable to delete file: c:\www\tomcat\crawls\test\TestingCode.site\crawldir\segments\20101128194700\parse_test\part-00000\data".
These files were created by a previous run of the same program (which does some Nutch crawling). Doing an ls -l under cygwin shows the user and group are correct, but the perms are 000.
Further info:
dirdoesn’t tell me anything about permissions.- I can remove the directory with
delon a cmd.exe window orrm -rfon a cygwin bash window. - The files in question, and the directory they are in, were created earlier in the same run of the same program.
- The computer is running Windows 7, so I assume that means it’s NTFS.
Plenty of possibilities here. The path itself doesn’t look bad. Your best bet is to try to delete that directory manually from a command prompt and see what error you get.
Things to check:
dir, notls).