Copying latest version of the file

K

Kali K E

Hi,
I am new to Python and excuse me if this problem is very trivial. The
problem is like this.
There is a directory (dirA) that contains files like
mypacakge-2.2.5-15.rpm, mypacakge-2.2.5-90.rpm,
anotherpackage-3.4.25.rpm etc.. As can be seen, some of the files are
new versions of same rpm (mypacakge-2.2.5-15.rpm,
mypacakge-2.2.5-90.rpm in this example). It is also true that their
timestamps are different. The program has to check for latest version
of each package and copy them to another directory (dirB). That means
in this case, it has to copy mypacakge-2.2.90.rpm to another
directory.
The directory dirA would be containing more than 500 files. Out of
these many, about 100 files may be having new version.
Another point is the number of files of same package is NOT limited to
2. So we may have mypacakge-2.2.5-15.rpm, mypacakge-2.2.5-90.rpm,
mypacakge-2.2.5-100.rpm, mypacakge-2.2.5-227.rpm in dirA and only
mypacakge-2.2.5-227.rpm has to be copied to dirB.
The same thing has to be repeated in other directories at the same
level as dirA.
Please let me know how to do this.
Thanks,
Kali
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top