On Friday 10 February 2006 11:45, Thorbjørn Ravn Andersen wrote:
> Glenn Holmer wrote:
> >>>Anybody know if there's an API in JTOpen to get the timestamp of a
> >>>file member (so we can get rid of some old PCML code that calls
> >>>into OS/400)?

> I meant to just call e.g. "new IFSFile" with the full name of the
> member (/QSYS..../WHATEVER.MBR), and then ask for whatever you need
> (exists(), lastModified(), etc).

Yes, that works, thanks.  We don't need to read it, we just want to use 
it in a purge program that deletes old members that represent orders 
sent from a web server.  The purge program runs on the web server 
itself, which is a Linux box.

Cool piece of code, this "AS/400 Toolbox for Java"!  :)

Here's a snip from the test program:

weyco400 = new AS400("machine", "user", "password");
ifsFile = new IFSFile(weyco400, 
          "/QSYS.LIB/SHADOW.LIB/SHADOWSRC.FILE/CCOLORS.MBR");
if (ifsFile.exists()) {
  lastModified = ifsFile.lastModified();
  if (lastModified > 0) {
    date = new Date(lastModified);
    sdf = new SimpleDateFormat("MM/dd/yyyy");
    System.out.println("member date: " + sdf.format(date));
  }
}


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.