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:
dir
doesn't tell me anything about permissions.del
on a cmd.exe window or rm -rf
on a cygwin bash window.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
, not ls
).