moshfiqur
moshfiqur

Reputation: 2139

Java program to trace file copying

I want to write a java program which will run in background and trace which file is copying from which source to destination. This program will write this info to a log file. But I am not sure from where to start. Is there anyone out there who can help me to find the starting point?

Edit

I have no restriction to use java. I am open to use any programming language even if its any kind of shell script, I am totally ok. (but only thing is I am on win7). But java would be better :)

Upvotes: 4

Views: 334

Answers (2)

StanislavL
StanislavL

Reputation: 57381

Read this to see how to organize file system watches http://e-blog-java.blogspot.com/2011/03/how-to-watch-file-system-for-changes-in.html

Upvotes: 2

Amir Afghani
Amir Afghani

Reputation: 38531

I'm not sure you can know both the source and destination of the copy (at least in Java), but in Java 7 there is a way to watch a directory for create/modification/delete. Read this tutorial.

Upvotes: 1

Related Questions