Hi, I'm currently using the file change detection resource that was added in
Java 7 in the nio package and I'm a little confused by the results that I'm getting.
I broke down the detection to the simplest format to get pure results, but the results I get don't make sense to me.
This is the code that I am using to simply print out when a file in the current directory is changed and what kind of change occurred; created, deleted, or modified. It works, but there seem to be strange/differing results from Linux to Windows
In linux it prints the following when the file "text.txt" is edited, and doesn't print anything if a blank file is created or deleted
File Name: test.txt
File Path: /home/patrick/workspace2/Test/.
Event Kind: ENTRY_MODIFY
In windows it prints the same whenever a file is edited or deleted and still doesn't print anything when a blank one is created
Stranger still, when a file is edited with gedit it prints the following
File Name: .goutputstream-CV8LKX
File Path: /home/patrick/workspace2/Test/.
Event Kind: ENTRY_MODIFY
Is there any possible way to reconcile this behaviour? The differences from Windows to Linux are acceptable, but I really need to be able to access the correct file name.
Thanks a lot for your help