| Summary: | [resources] File.create in read-only directory should set more specific error code | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Knut Radloff <knut_radloff> |
| Component: | Resources | Assignee: | Rafael Chaves <eclipse> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | dj.houghton, n.a.edgar |
| Version: | 2.0 | ||
| Target Milestone: | 2.1 M3 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
|
Description
Knut Radloff
I don't like the idea if writing a file fails, then call #isReadOnly on all of its parents up the hierarchy. This could potentially be a very costly operation since it involves going to the file system for each call and the file system is not necessarily local in all cases. Adding NE to CC for comment. If Core does not want to do this, then this should be closed as WONTFIX, and we can add the check at the UI level. While Core doesn't want to incur this expense for every file write, it's not unreasonable for the UI to do this just for the case of manually creating a new file (bug 3043). Marking as WONTFIX. You don't have to walk up the hierarchy. Creating a file only fails on Linux when the immediate parent is read-only. You only have to check the immediate parent folder. Is that still too expensive for core to support? It would save clients that display the error message a lot of trouble. Re-opening for consideration. Ok, I can do that. As long as we don't come back later with a file system which
requires us to walk the whole hierarchy up to the root. :-)
Fixed and released into HEAD.
Added new error constant IResourceStatus.PARENT_READ_ONLY.
Message is: "Parent of file: {0} is marked as read-only.".
Naturally I'd like the same improved error reporting when creating a folder within a read-only folder. Oops, sorry. Code should go in/around FileSystemStore.writeFolder(). Need to write appropriate test case as well. Fixed, tested and released into HEAD. |