Re: Passing each of the files in a directory as parameter to the perl script

2007-08-08 Thread Ken Foskey
On Wed, 2007-08-08 at 22:26 +0200, Dr.Ruud wrote: > You might be able to change this to creating (and filling) the files in > a tmp directory, and move them to the processing directory once they are > finished. Then there is no need to have those 0-bytes flag files. A bit > like how a maildir work

Re: Passing each of the files in a directory as parameter to the perl script

2007-08-08 Thread Dr.Ruud
"Mihir Kamdar" schreef: > There is a parent directory where the input files will be stored. > These files will keep on coming into the parent directory. There is a > child directory where these input files will just get touched(0 byte > files). You might be able to change this to creating (and fi

Re: Passing each of the files in a directory as parameter to the perl script

2007-08-01 Thread Mihir Kamdar
On 8/2/07, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote: > > Mihir Kamdar wrote: > > It has to be ASAP Shawn..but if that's not possible, as a workaround > > we may also look at every half hour or something like that... > > > > do you have any suggestions in mind? > > Well, if I could change an

Re: Passing each of the files in a directory as parameter to the perl script

2007-08-01 Thread Mr. Shawn H. Corey
Mihir Kamdar wrote: It has to be ASAP Shawn..but if that's not possible, as a workaround we may also look at every half hour or something like that... do you have any suggestions in mind? Well, if I could change anything, I'd change my program to a deamon and have it listen on a socket.

Re: Passing each of the files in a directory as parameter to the perl script

2007-08-01 Thread Rob Dixon
Mihir Kamdar wrote: Can you explain with reference to your code, what does this do: my $access = (stat $fname)[8]; In my last post I asked you to please bottom-post your responses to this group. That means to put your reply after the text of the message you are replying to. If you look at

Re: Passing each of the files in a directory as parameter to the perl script

2007-08-01 Thread Paul Lalli
On Aug 1, 11:57 am, [EMAIL PROTECTED] (Mihir Kamdar) wrote: > > On 8/1/07, Paul Lalli < [EMAIL PROTECTED]> wrote: > > > my %already_seen; > > > while (1) { > > >opendir my $dh, '.' or die "Could not open this directory: $!"; > > >while (my $file = readdir($dh)) { > > >next if $file

Re: Passing each of the files in a directory as parameter to the perl script

2007-08-01 Thread hwigoda
i believe it returns the permissions of the file to $access. -Original Message- >From: Mihir Kamdar <[EMAIL PROTECTED]> >Sent: Aug 1, 2007 10:49 AM >To: Paul Lalli <[EMAIL PROTECTED]> >Cc: beginners@perl.org >Subject: Re: Passing each of the files in a directo

Re: Passing each of the files in a directory as parameter to the perl script

2007-08-01 Thread Mihir Kamdar
Also.after reading each file and processing it, I want to write the output for each of them to a different directory. @Paul: my process_file($file) would scan the file and remove duplicate records from the file and write the o/p into another directory. That part is taken care of. On 8/1/07, M

Re: Passing each of the files in a directory as parameter to the perl script

2007-08-01 Thread Mihir Kamdar
hey Rob, Can you explain with reference to your code, what does this do: my $access = (stat $fname)[8]; On 8/1/07, Paul Lalli <[EMAIL PROTECTED]> wrote: > > On Aug 1, 11:14 am, [EMAIL PROTECTED] (Mihir Kamdar) wrote: > > It has to be ASAP Shawn..but if that's not possible, as a workaround >

Re: Passing each of the files in a directory as parameter to the perl script

2007-08-01 Thread Paul Lalli
On Aug 1, 11:14 am, [EMAIL PROTECTED] (Mihir Kamdar) wrote: > It has to be ASAP Shawn..but if that's not possible, as a workaround we > may also look at every half hour or something like that... So enter an infinite loop in which you process the directory, sleep one second, process the directo

Re: Passing each of the files in a directory as parameter to the perl script

2007-08-01 Thread Mihir Kamdar
yep Rob...u re right... the code that u've posted should do good...am yet to test it Thanks, Mihir On 8/1/07, Rob Dixon <[EMAIL PROTECTED]> wrote: > > Mihir Kamdar wrote: > > > > On 8/1/07, Rob Dixon <[EMAIL PROTECTED]> wrote: > >> > >> Mihir Kamdar wrote: > >>> > >>> I have a requirement to re

Re: Passing each of the files in a directory as parameter to the perl script

2007-08-01 Thread Rob Dixon
Mihir Kamdar wrote: On 8/1/07, Rob Dixon <[EMAIL PROTECTED]> wrote: Mihir Kamdar wrote: I have a requirement to read each of the files from a directory and pass each one of them as a parameter to my perl script one by one. The requirement is such that my perl script should keep running in th

Re: Passing each of the files in a directory as parameter to the perl script

2007-08-01 Thread Mihir Kamdar
hey Tom, There is no question of half finished files...because only files that are finished being written will be touched in the child directory. So any touched file in the child directory will have a fully written input file in the parent directory. That's precisely the reason that first I will s

Re: Passing each of the files in a directory as parameter to the perl script

2007-08-01 Thread Mihir Kamdar
It has to be ASAP Shawn..but if that's not possible, as a workaround we may also look at every half hour or something like that... do you have any suggestions in mind? I am also unaware how to scan the directory for each of the fileslike in shell i can do something like for i in 'ls -lrt *

Re: Passing each of the files in a directory as parameter to the perl script

2007-08-01 Thread Tom Phoenix
On 8/1/07, Mihir Kamdar <[EMAIL PROTECTED]> wrote: > There is a parent directory where the input files will be stored. These > files will keep on coming into the parent directory. When you say "keep on coming", what do you mean? Do you mean that another process is writing these files elsewhere (i

Re: Passing each of the files in a directory as parameter to the perl script

2007-08-01 Thread Mr. Shawn H. Corey
Mihir Kamdar wrote: Also, these input files will keep on coming from some source. So, my perl file has to run continuously and pick each of the files as they come. How quickly does the Perl program have to process these files? ASAP, once an hour, once a day? -- Just my 0.0002 million dol

Re: Passing each of the files in a directory as parameter to the perl script

2007-08-01 Thread Mihir Kamdar
Hi Rob, My requirement is like this:- There is a parent directory where the input files will be stored. These files will keep on coming into the parent directory. There is a child directory where these input files will just get touched(0 byte files). I have to read the name of the file from the

Re: Passing each of the files in a directory as parameter to the perl script

2007-08-01 Thread Rob Dixon
Mihir Kamdar wrote: I have a requirement to read each of the files from a directory and pass each one of them as a parameter to my perl script one by one. The requirement is such that my perl script should keep running in the background and it should take each of the files as they enter into the