find files created/accessed in last n hours

find files created/accessed in last n hours

am 10.04.2008 07:42:15 von nag

------=_Part_14187_26566653.1207806135261
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

hi,
please help me to get all the files present in a directory which are
created/accessed in last 4 hours .


thanks
Nagesh

--
Thanks
Nagesh

------=_Part_14187_26566653.1207806135261--

Re: find files created/accessed in last n hours

am 10.04.2008 07:50:05 von chas.owens

On Thu, Apr 10, 2008 at 1:42 AM, nag wrote:
> hi,
> please help me to get all the files present in a directory which are
> created/accessed in last 4 hours .
snip

Take a look at File::Find* and the stat function** or -M***. You may
also want to read perldoc -q "How do I get a file's timestamp in
perl?"****


* http://perldoc.perl.org/File/Find.html
** http://perldoc.perl.org/functions/stat.html
*** http://perldoc.perl.org/functions/-X.html
**** http://perldoc.perl.org/perlfaq5.html#How%20do%20I%20get%20a %20file%27s%20timestamp%20in%20perl?

--
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: find files created/accessed in last n hours

am 10.04.2008 07:52:52 von peng.kyo

use File::Find can do that.
or use the unix 'find' command:

find /path -type f -mmin -240

On 4/10/08, nag wrote:
> hi,
> please help me to get all the files present in a directory which are
> created/accessed in last 4 hours .
>
>
> thanks
> Nagesh
>
> --
> Thanks
> Nagesh
>

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: find files created/accessed in last n hours

am 10.04.2008 08:01:35 von Gunnar Hjalmarsson

nag wrote:
> please help me to get all the files present in a directory which are
> created/accessed in last 4 hours .

perldoc -f readdir
perldoc -f grep
perldoc -f -M

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: find files created/accessed in last n hours

am 10.04.2008 08:48:16 von nag

------=_Part_14495_9367282.1207810096301
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

can some one please give the exact code for this..


thanks,
Nagesh
On Thu, Apr 10, 2008 at 11:31 AM, Gunnar Hjalmarsson
wrote:

> nag wrote:
>
> > please help me to get all the files present in a directory which are
> > created/accessed in last 4 hours .
> >
>
> perldoc -f readdir
> perldoc -f grep
> perldoc -f -M
>
> --
> Gunnar Hjalmarsson
> Email: http://www.gunnar.cc/cgi-bin/contact.pl
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> http://learn.perl.org/
>
>
>


--
Thanks
Nagesh

------=_Part_14495_9367282.1207810096301--

Re: find files created/accessed in last n hours

am 10.04.2008 08:54:55 von chas.owens

On Thu, Apr 10, 2008 at 2:48 AM, nag wrote:
> can some one please give the exact code for this..
snip

No, we can provide you with rate cards for contract work, or you can
take a stab at reading the docs and throwing together a script. If
you have specific questions about the language, or need clarification
about how things work, we will be happy to answer them.

--
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: find files created/accessed in last n hours

am 10.04.2008 13:20:59 von Richard Lee

Chas. Owens wrote:
> On Thu, Apr 10, 2008 at 1:42 AM, nag wrote:
>
>> hi,
>> please help me to get all the files present in a directory which are
>> created/accessed in last 4 hours .
>>
> snip
>
> Take a look at File::Find* and the stat function** or -M***. You may
> also want to read perldoc -q "How do I get a file's timestamp in
> perl?"****
>
>
> * http://perldoc.perl.org/File/Find.html
> ** http://perldoc.perl.org/functions/stat.html
> *** http://perldoc.perl.org/functions/-X.html
> **** http://perldoc.perl.org/perlfaq5.html#How%20do%20I%20get%20a %20file%27s%20timestamp%20in%20perl?
>
>
Just out of curiosity to all perl experts in here...

how many times did you guys read entire perl FAQs ?

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: find files created/accessed in last n hours

am 10.04.2008 16:37:00 von merlyn

>>>>> "Richard" == Richard Lee writes:

Richard> Just out of curiosity to all perl experts in here...

Richard> how many times did you guys read entire perl FAQs ?

Every time one of you says something that sounds like a FAQ.

:-)

But seriously, I still skim the FAQ headlines about once a month (via "perldoc
perlfaq") to remind myself what's there. I also watch the changes to the FAQ
when a new release has come out so I know if there's been any simpler or more
advanced techniques for common problems.

And until you can say you know for sure that it's not a FAQ, you should be
skimming the FAQ headlines (if not the content) regularly as well. Lots of
good stuff in there. After all, we've had nearly two decades of accumulated
usage of Perl.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095

Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: find files created/accessed in last n hours

am 10.04.2008 19:53:37 von Richard Lee

Randal L. Schwartz wrote:
>>>>>> "Richard" == Richard Lee writes:
>>>>>>
>
> Richard> Just out of curiosity to all perl experts in here...
>
> Richard> how many times did you guys read entire perl FAQs ?
>
> Every time one of you says something that sounds like a FAQ.
>
> :-)
>
> But seriously, I still skim the FAQ headlines about once a month (via "perldoc
> perlfaq") to remind myself what's there. I also watch the changes to the FAQ
> when a new release has come out so I know if there's been any simpler or more
> advanced techniques for common problems.
>
> And until you can say you know for sure that it's not a FAQ, you should be
> skimming the FAQ headlines (if not the content) regularly as well. Lots of
> good stuff in there. After all, we've had nearly two decades of accumulated
> usage of Perl.
>
>
:-)

good to know.

perlfaq honestly is fairly hard to read in one sitting however as they
cover a broad topic and when someone really needs it, it's hard to go
through them or even think about what to type
such as perldoc -f "how do i do XXXXX".. but I tried it few times and
gave up and thought to myself.. "who in the hell would go over entire
list of something like this ?"

Now I know what to do :-) thanks !!

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/