Bug 359817 - ResourceAttributes.isHidden does not work on Linux hidden files
Summary: ResourceAttributes.isHidden does not work on Linux hidden files
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 3.7   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.8 M4   Edit
Assignee: Szymon Brandys CLA
QA Contact:
URL:
Whiteboard:
Keywords: Documentation
Depends on:
Blocks:
 
Reported: 2011-10-04 06:24 EDT by Andreas Pakulat CLA
Modified: 2011-11-16 09:09 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Pakulat CLA 2011-10-04 06:24:11 EDT
Build Identifier:  I20110613-1736

Asking a resource named ".foo" for its resource attributes and checking the isHidden flag returns false. This is wrong on Linux/Unix, all files starting with a leading dot are considered hidden on that OS.

The package and project explorer will also hide such files by default on Linux, the Navigator shows them

Reproducible: Always

Steps to Reproduce:
1. Create a project
2. Create a file inside the project named ".foo"
3. Run some code which checks via ResourceAttributes.isHidden wether the file is hidden, it'll report the file to be not hidden.
Comment 1 John Arthorne CLA 2011-10-05 14:55:34 EDT
The ResourceAttributes object is intended to capture platform specific metadata about files - hidden/archive are only applicable on Windows, and the executable attribute is only applicable on *nix platforms. 

I think it would be a mistake to attempt to treat the Unix file naming convention in the same way as the Windows hidden attribute.  If you try to disable the hidden attribute using IResource#setResourceAttributes, would you expect the file to be renamed on Linux?
Comment 2 Andreas Pakulat CLA 2011-10-05 17:32:09 EDT
(In reply to comment #1)
> The ResourceAttributes object is intended to capture platform specific metadata
> about files - hidden/archive are only applicable on Windows, and the executable
> attribute is only applicable on *nix platforms. 
> 
> I think it would be a mistake to attempt to treat the Unix file naming
> convention in the same way as the Windows hidden attribute.  If you try to
> disable the hidden attribute using IResource#setResourceAttributes, would you
> expect the file to be renamed on Linux?

Hmm, thats true. For the getter it would still be nice though, but it should at least be more clearly communicated in the documentation IMHO. The docs say the attributes are platform-dependent, but not which work on which platform. Due to the 2-value return s for the boolean getters its not easy to differ between bugs in the implementation and 'not supported on this platform'...