Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Mono is not able to notice a file change in a FileInfo object #6283
Steps to Reproduce
Scenario: We are running on Linux (Mono) a set of tests developed in Windows (c# .Net).
Both instances of the file are the same.
The two instances must be different after the update, becasue we are adding some content to the file.
On which platforms did you notice this
[ ] macOS
With the current code on Mac:
With the pull request applied on Mac:
Not all filesystems have nanosecond precision, so you might not see it.
referenced this issue
Dec 20, 2017
It's enough for you if a paste a piece of code here in a post?.
It is an example of our current situation:
The first time we call GetChangedContent, we notice the creation of the file when we compare the FileInfo object instances.
Then we decided to add some tricky code in order to catch the changes. We call a method to iterate through the FileInfo properties using reflection:
Once we have executed this method, Mono is able to be noticed about the changes.
Please, don't hesitate to request more information if you need it.
I really appreciate your help.
@csances I'm a bit confused by this issue: are you saying you expect the FileInfo object to automatically notice changes to the file? That's not how it works, you need to call the
If I'm missing something please provide a self-contained code sample that shows the problem, i.e. I assume the interesting logic is behind
I really appreciate your comments.
Please don't hesitate in asking me if you need furhter explanation.
Thank you ;)
Thank you for your help. Finally we have been able to fix the problem using Refresh method from FileInfo object.