Paul Herring wrote: > > On Wed, Jul 16, 2008 at 2:59 PM, Knowledge Seeker > <[EMAIL PROTECTED] <mailto:knowledgeseeker78%40gmail.com>> > wrote: > [...] > > Process A creates a txt file containing a line "A quick brown fox jumps > > over the lazy little dog" > > Process B reads the txt file and displays it on the screen and then > > deletes the file. > > Process A again does .... process b again does the same ... > > Ah - homework. > > The canonical method of doing this is for process A to open for > exclusive access a file (with filename returned from tmpnam() or > similar), dump what it wants to in there, then close it. > > Process B looks for files that it's able to open, process them, then > deletes them after. > > -- > PJH > > . > > First of all its no homework, I am a professional of window's world struggling in linux. I could have easily done it using win32 apis and have not come over here for help. And you are still not getting the problem I have asked for :), Brett understood it and suggested me to 'man' for fstat.
Brett.... I have seen the data structure returned by fstat but I have to think on the patterns of changes reflected in st_atimespec st_mtimespec st_ctimespec or even st_size but I was thinking on some other manner that could simply tell me that a file has been copied Currently I am going through http://man.he.net/man2/fcntl over there I have found something called File and directory change notification (dnotify) F_NOTIFY (Linux 2.4 onwards) Provide notification when the directory referred to by fd or any of the files that it contains is changed. The events to be notified are specified in arg, which is a bit mask specified by ORing together zero or more of the following bits: DN_CREATE A file was created (open, creat, mknod, mkdir, link, symlink, rename) Let me see if I can understand that.
