> -----Original Message-----
> From: Mihir Kamdar
> Sent: Thursday, August 02, 2007 8:15 AM
> To: beginners
> Subject: Re: Problem with my code
> 
> On 8/2/07, Mihir Kamdar wrote:
> >
> >
> >
> > On 8/2/07, Mihir Kamdar wrote:
> > >
> > > Hi,
> > >
> > > I have a requirement. There are files in the parent 
> directory and they
> > > are touched in the child directory. So in child directory 
> there are 0 byte
> > > files having the same name as the ones in the parent 
> directory. I need to
> > > read files in the child directory, and for each file 
> present in the child
> > > directory, I need to take that file from the parent 
> directory, process that
> > > file(remove duplicate lines from that file), and then 
> write the output for
> > > each of the input files in the output directory.
> > >
> > > I have written the code as below but it gives 0 byte 
> files as output.
> > > Please suggest what is wrong with the below code.
> > > I have a fear that instead of processing files from 
> parent directory, it
> > > is processing files from the child directory.
> > >
> > > I am a newbie at perl. So i might have made silly 
> mistakes. Request you
> > > to correct them.
> >
> > Hi,
> No replies from anybody. Can anybody plz help me with the above code?
> 
> Thanks,
> Mihir

First of all, I think you need to fix your description of the
requirements. This section doesn't make a lot of sense to me. If the
file is in your parent directory, it can't be touched in another
directory unless there is a symlink there.

If I understand what you are trying to say, you have a data file in one
directory with a matching tag file in another. Each time the data file
is updated, the tag file is touched to indicate the update is completed.
Then a second process must read and clean up that data file, either
deleting it when done, or renaming or moving it before it starts?

But, is it possible to overwrite or append data to an unprocessed file
in the data directory, or must the external process wait until it is
deleted, moved or renamed then create a new empty file before it can
save new data? Is there any way that both processes might try to access
the data file simultaneously, with one writing while the other is still
reading?

Does the tag file get deleted, moved or renamed along with the data
file?

When a new data file is added, does the tag file also get created by
that process, or is there a manual step to create it?

How frequently does each data file get updated?

How frequently does a new file name get added to those directories?

Is it necessary to work on more than one file at a time, or is a single
task loop adequate to keep up with the input?

Once you have a complete description, the usefulness of the advice
should improve.

Bob McConnell

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to