3

If I edit a hidden file in Notepad, I can save changes. Editing and then attempting to save that same file in Wordpad causes an "Access to C:...\file.txt" was denied" dialog to pop up.

In my very specific scenario, I'm frustrated that I can't hide my .ReSharper.user files. If I do, the next time I close down Visual Studio, ReSharper complains that it can't save my settings.

Argh! Why are Windows programs inconsistent with being able to write to hidden files? Why does the hidden attribute of a file affect its writability at all?

Oliver Salzburg
  • 89,072
  • 65
  • 269
  • 311
xofz
  • 373

2 Answers2

1

Have you checked to make sure that your .ReSharper.user files aren't marked as read-only? As far as I can test, Visual Studio 2008 and 2010 can write to hidden files just fine (look for a .suo file next to your solution to check). If you're using version control systems, it'll generally mark the file as read-only while they're checked in. If you are, you've probably included the .ReSharper.user files in with your project and checked them in which would have made them read-only. Check them out or remove them from source control to be able to write to them.

Joshua
  • 4,574
1

I am currently able to reproduce the issue in ReSharper v6.0. Issue likely stems from a File.Exists() call not detecting the file when hidden. As such, I've logged a ticket for potential resolution:

RSRP-287503 Error saving solution settings ( ReSharper.user ) if file is hidden

I wouldn't say that Windows programs are inconsistent when working with hidden files, but care must be used when designing software to properly accommodate situations where accessing a hidden file might come into play ( as in this instance with ReSharper )

sean2078
  • 442