FileSystemChange could usefully supply a #time getter...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

FileSystemChange could usefully supply a #time getter...

Tim M
Gosh I hate to say this ;-) but given how windows seems to generate change
events all over the place, and Dolphin helpfully documents this but leaves
it as an excercise to the reader - you get stuck trying to detect duplicate
changes without having access to all of the info. (and it FileSystemChange
is just a data object).

I seem to find that duplicate modified events on a file seem to be about
100000 nanoseconds apart (however I have had to add a loose method to FileSystemChange
to do this) - so it would seem that this is a candidate to have already present
to prevent collisions. I also get more than 2 changes on larger files (so
I wonder if changes occur due to buffered writes on some byte boundary).

If anyone else happens to need this - I am using this method (so far) to
reduce duplicates:

sameTimeAs: aFileSystemChange
        ^self species == aFileSystemChange species
                and: [
                        (time asInteger - aFileSystemChange time asInteger)  <= 100000 ]