Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to get the last 10 file in ftp server using ftp client  RSS feed

 
Wroyce Misa
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


}

public static FTPFile lastFileModified(FTPFile[] files) {
Date lastMod = files[0].getTimestamp().getTime();
FTPFile choice = null;
for (FTPFile file : files) {
if (file.getTimestamp().getTime().after(lastMod)) {
choice = file;
lastMod = file.getTimestamp().getTime();
}
}
return choice;
}
 
Wroyce Misa
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I only get the last latest file but i want to get the last 12 latest file in ftp server Thank you in advance wrote:

}

public static FTPFile lastFileModified(FTPFile[] files) {
Date lastMod = files[0].getTimestamp().getTime();
FTPFile choice = null;
for (FTPFile file : files) {
if (file.getTimestamp().getTime().after(lastMod)) {
choice = file;
lastMod = file.getTimestamp().getTime();
}
}
return choice;
}
 
Wroyce Misa
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wroyce Misa wrote:
 
Wroyce Misa
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wroyce Misa wrote:
I only get the last latest file but i want to get the last 12 latest file in ftp server Thank you in advance wrote:
 
Dave Tolls
Ranch Hand
Posts: 2504
27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why the multiple posts?

Print out the timestamps for all the files.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!