<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: finding time differences between 2 files in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-time-differences-between-2-files/m-p/3032160#M132833</link>
    <description>Shells (csh &amp;amp; sh) have poor time support.  I would use the system call 'stat' to get the time info.  You can either write a C program or access stat from perl.  This will allow you to calculate the time difference in seconds, if that is what you are after.</description>
    <pubDate>Thu, 24 Jul 2003 08:37:08 GMT</pubDate>
    <dc:creator>Martin Robinson</dc:creator>
    <dc:date>2003-07-24T08:37:08Z</dc:date>
    <item>
      <title>finding time differences between 2 files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-time-differences-between-2-files/m-p/3032159#M132832</link>
      <description>Good day,&lt;BR /&gt;I need a script that will tell me the time difference between 2 files.  I know that has to been been done before but I am having trouble finding it on the net.  Acually I found one but it bombs.  Any help much appreciated and reciprocated!&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Mike Blansfield&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 24 Jul 2003 08:32:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/finding-time-differences-between-2-files/m-p/3032159#M132832</guid>
      <dc:creator>Mike Blansfield</dc:creator>
      <dc:date>2003-07-24T08:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: finding time differences between 2 files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-time-differences-between-2-files/m-p/3032160#M132833</link>
      <description>Shells (csh &amp;amp; sh) have poor time support.  I would use the system call 'stat' to get the time info.  You can either write a C program or access stat from perl.  This will allow you to calculate the time difference in seconds, if that is what you are after.</description>
      <pubDate>Thu, 24 Jul 2003 08:37:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/finding-time-differences-between-2-files/m-p/3032160#M132833</guid>
      <dc:creator>Martin Robinson</dc:creator>
      <dc:date>2003-07-24T08:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: finding time differences between 2 files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-time-differences-between-2-files/m-p/3032161#M132834</link>
      <description>Although my perl is not good, this works:&lt;BR /&gt;&lt;BR /&gt;$file1=@ARGV[0];&lt;BR /&gt;$file2=@ARGV[1];&lt;BR /&gt;@stat1 = stat($file1);&lt;BR /&gt;@stat2 = stat($file2);&lt;BR /&gt;$time1 = @stat1[9];&lt;BR /&gt;$time2 = @stat2[9];&lt;BR /&gt;print "File $file1 $time1\n";&lt;BR /&gt;print "File $file2 $time2\n";&lt;BR /&gt;$diff = $time2 - $time1;&lt;BR /&gt;print "Difference is $diff seconds\n";</description>
      <pubDate>Thu, 24 Jul 2003 08:56:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/finding-time-differences-between-2-files/m-p/3032161#M132834</guid>
      <dc:creator>Martin Robinson</dc:creator>
      <dc:date>2003-07-24T08:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: finding time differences between 2 files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-time-differences-between-2-files/m-p/3032162#M132835</link>
      <description>Here's a Perl script that can optionally determine if a file is older than an arbitrary number of seconds OR (with the -e arg will output the datestamp (in seconds since 1-Jan-1970 0000 UTC). It will by default use modification time but can optionally output last access time or last change (chmod) time.&lt;BR /&gt;&lt;BR /&gt;Invoke as fileage.pl for full usage.&lt;BR /&gt;&lt;BR /&gt;Here is an example of your task:&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;PROG=${0}&lt;BR /&gt;if [[ ${#} -ne 2 ]]&lt;BR /&gt;  then&lt;BR /&gt;    echo "Usage: ${PROG} file1 file2" &amp;gt;&amp;amp;2&lt;BR /&gt;    exit 255&lt;BR /&gt;  fi&lt;BR /&gt;F1=${1}&lt;BR /&gt;F2=${2}&lt;BR /&gt;shift 2&lt;BR /&gt;AGE=$(( $(fileage.pl -e ${F1}) - $(fileage.pl -e ${F2}) ))&lt;BR /&gt;echo "${AGE}"&lt;BR /&gt;exit 0&lt;BR /&gt;  &lt;BR /&gt;</description>
      <pubDate>Thu, 24 Jul 2003 12:54:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/finding-time-differences-between-2-files/m-p/3032162#M132835</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2003-07-24T12:54:38Z</dc:date>
    </item>
  </channel>
</rss>

