473,387 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

how to find a last updated directory?

89
Suppose I have a set of directories as lane1, lane2, lane3, file1, file2..under /home/userrig/test in a linux server. And the last updated directory is lane3.

lane1, lane2 and lane3 are directories and file1 and file2.. are under files under /home/userrig/test.

I am only interested in directory that starts with
Expand|Select|Wrap|Line Numbers
  1. lane

How do I collect this information? Infact after cheking for the last updated directory, I have to change to that directory and execute a command in
Expand|Select|Wrap|Line Numbers
  1. system("execute");
method.

Is there any function to sort the directory according to time like "ls - lt" as in unix command? Please let me know how to proceed?

Thanks and Regards
Jul 16 '08 #1
3 2933
lilly07
89
Any expert advice or suggestions needed please.
Jul 17 '08 #2
Suppose I have a set of directories as lane1, lane2, lane3, file1, file2..under /home/userrig/test in a linux server. And the last updated directory is lane3.

lane1, lane2 and lane3 are directories and file1 and file2.. are under files under /home/userrig/test.

I am only interested in directory that starts with
Expand|Select|Wrap|Line Numbers
  1. lane

How do I collect this information? Infact after cheking for the last updated directory, I have to change to that directory and execute a command in
Expand|Select|Wrap|Line Numbers
  1. system("execute");
method.

Is there any function to sort the directory according to time like "ls - lt" as in unix command? Please let me know how to proceed?

Thanks and Regards

I replied to ur last post also, here is the code that gets the latest directory whose name starts with lane.

Expand|Select|Wrap|Line Numbers
  1. my $latest_dir = (grep { chomp; /^lane/i } `ls -t`)[0];
regs,
Jul 17 '08 #3
lilly07
89
Thank you so much. As I overlooked my previous message, I couldn't respond. Sorry for the confusion caused.
Jul 17 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: JPM III | last post by:
I wrote a PHP script that allows me to post HTML entries to files on my server without going through FTP, yadda yadda. It works fine, and last night it updated both files properly. Today, it...
1
by: Thieum22 | last post by:
Hi, I try to go through a directory and it's subdirectories to reah the properties of each files. But I have a problem to set active the directory where the files are, in order to display their...
1
by: Amanda | last post by:
Hi, hope you can help me with this one. If I want to get the date a page has been last modified, I can do something like .. document.write("<b>Last updated: "+document.lastModified+"</b>"); ...
1
by: Bill Gibson | last post by:
My customer has asked for an email notification when a file has been sitting in a directory for too long without being accessed. Using FindFirstFile and FindNextFile the ftLastAccessTime IS NOT...
4
by: kieran | last post by:
Hi, I import data every evening through a scheduled task from a text file. Once the data is imported, an email is sent to a user saying how much data etc.. was in the file. In case the file...
2
by: Warmbells | last post by:
Hello, Most of the pages on the site I manage are html with a few with php snippits on them which are named .php, on the html pages I have a 'Last Updated' piece of code as follows Last...
6
by: Mudcat | last post by:
Hi, I can't figure out why ctypes won't load the DLL I need to use. I've tried everything I can find (and the ctypes website is down at the moment). Here's what I've seen so far. I've added...
1
by: Larry L [in Honolulu] | last post by:
I know how to use javascript to print the date a page was last updated in the HTML itself, but - Is it possible through javascript, to add something to the url of a page to find the date that...
1
by: mosesdinakaran | last post by:
Hi All, How to find out the last accessed date of a MySql Database. I have around 200 databases in my server some are used and some are not in Use, I want to remove the database that are not...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.