This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 253970 - Cleaner process cannot handle files with read-only attrib set (Windows)
Summary: Cleaner process cannot handle files with read-only attrib set (Windows)
Status: REOPENED
Alias: None
Product: installer
Classification: Unclassified
Component: NBI (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Libor Fischmeistr
URL:
Keywords: PATCH_AVAILABLE
Depends on:
Blocks:
 
Reported: 2015-07-30 07:52 UTC by phansson
Modified: 2015-07-30 14:30 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Patch (691 bytes, text/plain)
2015-07-30 07:52 UTC, phansson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description phansson 2015-07-30 07:52:54 UTC
Created attachment 155035 [details]
Patch

Currently the cleaner process on Windows cannot delete files that has the read-only attribute set. 

The main problem being that the Win32 DeleteFileW() function expects read-only attribs on a file to have been removed beforehand. The current cleaner.exe does not handle this.

I've created a small patch to fix this. It is just 2 lines of code.

It does the following: If the read-only attribute is set then remove it.

I've checked if the same problem exists in the cleaner for Unices (cleaner.sh) but that doesn't seem to be case as that script uses "rm -f" when attempting to delete a file. In other words: It is only the Windows version which has this problem.
Comment 2 Libor Fischmeistr 2015-07-30 14:30:58 UTC
(In reply to Libor Fischmeistr from comment #1)
> Fixed:
> 
> http://hg.netbeans.org/core-main/rev/9fda12a36ae9
> http://hg.netbeans.org/releases/rev/8c0614143f8e

Sorry, wrong issue.