Unix administration - How do I setup system time in Unix to fix my g++ problem?

This is Interesting: Free IT Magazines  
Home > Archive > Unix administration > August 2006 > How do I setup system time in Unix to fix my g++ problem?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author How do I setup system time in Unix to fix my g++ problem?
Mr. Ken

2006-07-28, 7:27 am

I am using Exceed for Windows NT to log on a Unix machine and run
simulations.
I realized that every file that is touched by my account will display time
like "Jul 28 2006",
however other files are like "Mar 1 13:57". This causes g++ to refuse
compiling my C++
codes (Error is ***.h has modification time in the future).

What can I do in the .cshrc file to correct this problem?


[vbcol=seagreen]
..... blah
drwxr-x--- 2 temp test 512 Jul 25 15:02 .simvision/
drwx------ 2 temp test 512 Jun 26 15:33 .solregis/
-rw------- 1 temp test 12288 Nov 25 2002 .swp
-rwxr-xr-x 1 temp test 17925 Jul 28 2006 .testfile
-rwxr-xr-x 1 temp test 17925 Sep 3 2001 .vuemrc*
-rwxr-xr-x 1 temp test 8618 Apr 26 2001 .vueprofile*
drwxr-x--- 3 temp test 512 Nov 8 2005 .windu/
drwxr-x--- 2 temp test 512 Mar 1 13:57 .windu.ultra27/
-rwxr-xr-x 1 temp test 680 Jun 20 2001 .xhpcalc*
..... blah


Thanks in advance.



jpd

2006-07-28, 7:27 am

Begin <44c9b7e2$1@news.starhub.net.sg>
On 2006-07-28, Mr. Ken <Mr> wrote:
> I am using Exceed for Windows NT to log on a Unix machine and run
> simulations. I realized that every file that is touched by my account
> will display time like "Jul 28 2006", however other files are like
> "Mar 1 13:57". This causes g++ to refuse compiling my C++ codes (Error
> is ***.h has modification time in the future).
>
> What can I do in the .cshrc file to correct this problem?


You are going about this the wrong way. You don't fix time problems by
changing your .cshrc.

The way to do this is to make sure the times of the files and the time
on the system is correct. If the time on the machine is incorrect, talk
to the administrator of the unix machine.

To deal with the files, make sure the machine where those files come
from has the correct time. To individually fix file times, you can use
the touch(1) utility. Type `man 1 touch' at the unix command line to
read how to use it. To read about the man command, type `man 1 man'.


Presumably you transfer the files to the unix machine, and from your
windows machine. I think the windows machine has the wrong time. You
should probably fix that instead.


--
j p d (at) d s b (dot) t u d e l f t (dot) n l .
This message was originally posted on Usenet in plain text.
Any other representation, additions, or changes do not have my
consent and may be a violation of international copyright law.
Mr. Ken

2006-07-28, 7:27 am


"jpd" <read_the_sig@do.not.spam.it.invalid> wrote in message
news:4itvhqF5d9ncU1@individual.net...
> Begin <44c9b7e2$1@news.starhub.net.sg>
> On 2006-07-28, Mr. Ken <Mr> wrote:
>
> You are going about this the wrong way. You don't fix time problems by
> changing your .cshrc.
>
> The way to do this is to make sure the times of the files and the time
> on the system is correct. If the time on the machine is incorrect, talk
> to the administrator of the unix machine.
>
> To deal with the files, make sure the machine where those files come
> from has the correct time. To individually fix file times, you can use
> the touch(1) utility. Type `man 1 touch' at the unix command line to
> read how to use it. To read about the man command, type `man 1 man'.
>
>
> Presumably you transfer the files to the unix machine, and from your
> windows machine. I think the windows machine has the wrong time. You
> should probably fix that instead.
>
>
> --
> j p d (at) d s b (dot) t u d e l f t (dot) n l .
> This message was originally posted on Usenet in plain text.
> Any other representation, additions, or changes do not have my
> consent and may be a violation of international copyright law.




Thank you jpd.

I was aware that touch *.* updates all the time of my source files. What I
don't understand is,
After I use "touch .testfile", then do a "ls -al", the .testfile will show a
time like "Jul 28 2006",
instead of "Jul 28 18:02" like all the rest files are. After 15 minutes, if
I do a "ls -al" again in the
terminal, it will show "Jul 28 18:02". It's very weird.

If I am not wrong, I am expecting g++ to recompile all the files after I do
"touch *.*" on my
source code files. It reports a list of "***.. has modification time in the
future" on all my source
codes and refuse to compile. 15 minutes later, it compiles.

Besides that, my Unix's time is forever 15 minutes later than my PC(which
shows correct local time).

So what are the problems with those machines in my workplace!





jpd

2006-07-28, 7:27 am

Begin <44c9d7e4$1@news.starhub.net.sg>
On 2006-07-28, Mr. Ken <Mr> wrote:
> I was aware that touch *.* updates all the time of my source files.


No, it does not. *.* is a DOS-ism. On unices, there is no guarantee the
filename will contain a dot, and without a dot, *.* will not match that
file. But it will match the special entries `.' and `..', and that might
cause havoc. So don't think "*.*" if you think ``all files'' on unix.


> What I don't understand is, After I use "touch .testfile", then do a
> "ls -al", the .testfile will show a time like "Jul 28 2006", instead
> of "Jul 28 18:02" like all the rest files are. After 15 minutes, if I
> do a "ls -al" again in the terminal, it will show "Jul 28 18:02". It's
> very weird.


That might be an artefact of ls. It shows the date and time, but without
the year, for the last six or twelve months or so, and outside of that
window it will show the year and the date. Fifteen minutes in the future
is clearly not between now and a year past.


> If I am not wrong, I am expecting g++ to recompile all the files after
> I do "touch *.*" on my source code files. It reports a list of "***..
> has modification time in the future" on all my source codes and refuse
> to compile. 15 minutes later, it compiles.


By default, touch should set the access and modification times of the
target(s). It might be that if the creation time is in the future g++
will look at that instead. Or it might be that you're reporting this
right after a transfer from your machine, which has different time.

I think, though, that it isn't g++ that reports the error, but your
particular brand of make. Here, neither g++ nor make (pmake) cares
whether a file is in the future or not, but possibly gmake might.


> Besides that, my Unix's time is forever 15 minutes later than my PC(which
> shows correct local time).


Well, there's your problem. Unices normally have their clock set to UTC
and a timezone setting to adjust the setting for the onlooker[1]. It is
a pretty good idea to have it run accurate time, too. As I already said,
talk to whoever is responsible for administrating that unix machine, and
have them fix it.

A good way to synchronising time is to run NTP on the unix box, and
then you can even feed that time to your peecee, so they'll always be
in sync. Don't do it the other way around as windows[2] is very bad at
accurate timekeeping, whereas unices generally are pretty good at it.
But as I said, ask your systems administrator about it.


[1] As it is entirely possible people from multiple timezones use the
same machine at the same time, you do want to be able to adjust
the timezone displayed on a per-user basis. With unix, you can.
[2] And it inherited this from DOS as well.

--
j p d (at) d s b (dot) t u d e l f t (dot) n l .
This message was originally posted on Usenet in plain text.
Any other representation, additions, or changes do not have my
consent and may be a violation of international copyright law.
Dave Hinz

2006-07-28, 7:27 am

On Fri, 28 Jul 2006 15:10:19 +0800, Mr. Ken <Mr> wrote:
> I am using Exceed for Windows NT to log on a Unix machine and run
> simulations.
> I realized that every file that is touched by my account will display time
> like "Jul 28 2006",


Displayed by what?

> however other files are like "Mar 1 13:57". This causes g++ to refuse
> compiling my C++
> codes (Error is ***.h has modification time in the future).


So what's wrong, the file timestamps or the system clock? You need
first to identify that.

> What can I do in the .cshrc file to correct this problem?


That wouldn't be where you'd fix this.

> .... blah
> drwxr-x--- 2 temp test 512 Jul 25 15:02 .simvision/
> drwx------ 2 temp test 512 Jun 26 15:33 .solregis/
> -rw------- 1 temp test 12288 Nov 25 2002 .swp
> -rwxr-xr-x 1 temp test 17925 Jul 28 2006 .testfile
> -rwxr-xr-x 1 temp test 17925 Sep 3 2001 .vuemrc*
> -rwxr-xr-x 1 temp test 8618 Apr 26 2001 .vueprofile*
> drwxr-x--- 3 temp test 512 Nov 8 2005 .windu/
> drwxr-x--- 2 temp test 512 Mar 1 13:57 .windu.ultra27/
> -rwxr-xr-x 1 temp test 680 Jun 20 2001 .xhpcalc*


Those look fine. What date does the system think it is? What are the
dates on the .h files?

Barry Margolin

2006-07-29, 1:23 am

In article <44c9d7e4$1@news.starhub.net.sg>, "Mr. Ken" <Mr. Ken@asdf>
wrote:

> I was aware that touch *.* updates all the time of my source files. What I
> don't understand is,
> After I use "touch .testfile", then do a "ls -al", the .testfile will show a
> time like "Jul 28 2006",
> instead of "Jul 28 18:02" like all the rest files are. After 15 minutes, if
> I do a "ls -al" again in the
> terminal, it will show "Jul 28 18:02". It's very weird


Unix displays the time of day if the modification time is between 1 year
ago and the current time. It displays the year if it's outside this
range. The clock on your PC is a little ahead of the clock on the Unix
system, so when you use "touch" you're setting the modification time to
a time in the future, which is outside the above range, so the year is
displayed.

> If I am not wrong, I am expecting g++ to recompile all the files after I do
> "touch *.*" on my
> source code files. It reports a list of "***.. has modification time in the
> future" on all my source
> codes and refuse to compile. 15 minutes later, it compiles.


15 minutes later, the time that you set is no longer in the future,
since your PC's clock is less than 15 minutes fast.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
Mr. Ken

2006-07-30, 1:24 am


"Barry Margolin" <barmar@alum.mit.edu> wrote in message
news:barmar-591383.22095728072006@comcast.dca.giganews.com...
> In article <44c9d7e4$1@news.starhub.net.sg>, "Mr. Ken" <Mr. Ken@asdf>
> wrote:
>
>
> Unix displays the time of day if the modification time is between 1 year
> ago and the current time. It displays the year if it's outside this
> range. The clock on your PC is a little ahead of the clock on the Unix
> system, so when you use "touch" you're setting the modification time to
> a time in the future, which is outside the above range, so the year is
> displayed.
>


Thank you for your reply.

Does it mean that Exceed uses PC's time to update the time of my
modified files on Unix server?



>
> 15 minutes later, the time that you set is no longer in the future,
> since your PC's clock is less than 15 minutes fast.
>


Later I will request to modify my PC time back by 20 minutes. Hope it will
solve my problem.



> --
> Barry Margolin, barmar@alum.mit.edu
> Arlington, MA
> *** PLEASE post questions in newsgroups, not directly to me ***
> *** PLEASE don't copy me on replies, I'll read them in the group ***




Dave Hinz

2006-07-30, 1:24 am

On Sun, 30 Jul 2006 12:42:15 +0800, Mr. Ken <Mr.Ken@novice.com> wrote:
>
> Later I will request to modify my PC time back by 20 minutes. Hope it will
> solve my problem.


Don't ask like that. Inform the PC admin that the time being inaccurate
causes build problems for you and probably others, and request that he
implement an NTP solution to keep the clocks right. Hopefully you've
already done that on your Unix system?
Barry Margolin

2006-07-30, 1:24 am

In article <eahap9$60u$1@mawar.singnet.com.sg>,
"Mr. Ken" <Mr.Ken@novice.com> wrote:

> "Barry Margolin" <barmar@alum.mit.edu> wrote in message
> news:barmar-591383.22095728072006@comcast.dca.giganews.com...
>
> Thank you for your reply.
>
> Does it mean that Exceed uses PC's time to update the time of my
> modified files on Unix server?


It sure looks like it. That's the only likely explanation for the files
having timestamps in the future.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
Dave Hinz

2006-07-30, 1:24 am

On Sun, 30 Jul 2006 02:04:40 -0400, Barry Margolin <barmar@alum.mit.edu> wrote:
>
> It sure looks like it. That's the only likely explanation for the files
> having timestamps in the future.


OK Barry, 2:00 AM? I'm on call this week so that's _my_ excuse;
I haven't noticed you doing middle of the night posts before. Want to
trade problems?

Dave

Doug Freyburger

2006-07-30, 7:28 am

Dave Hinz wrote:
> Barry Margolin wrote:
>
>
> OK Barry, 2:00 AM? I'm on call this week so that's _my_ excuse;
> I haven't noticed you doing middle of the night posts before. Want to
> trade problems?


On-call weekend up late. Part of an SA's life. These days I get a
week on-call every six. I've had worse cycles. G'nite.

Dave Hinz

2006-07-30, 1:21 pm

On 30 Jul 2006 00:25:49 -0700, Doug Freyburger <dfreybur@yahoo.com> wrote:
> Dave Hinz wrote:
>
> On-call weekend up late. Part of an SA's life. These days I get a
> week on-call every six. I've had worse cycles. G'nite.


Cycle I'm on is two on, two off. That needs to be fixed. Well the
second claims to be "secondary" but simultaneous calls happen offen
enough that it's on-call too.

I've heard there are places with an 8 week rotation and 24 hour coverage
during the week.

Barry Margolin

2006-07-30, 1:21 pm

In article <4j316rF64kn5U3@individual.net>,
Dave Hinz <DaveHinz@gmail.com> wrote:

> On Sun, 30 Jul 2006 02:04:40 -0400, Barry Margolin <barmar@alum.mit.edu>
> wrote:
>
> OK Barry, 2:00 AM? I'm on call this week so that's _my_ excuse;
> I haven't noticed you doing middle of the night posts before. Want to
> trade problems?
>
> Dave


Just watching TV and reading Usenet.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
James Nau

2006-08-01, 7:26 pm

Barry Margolin <barmar@alum.mit.edu> wrote:
: In article <eahap9$60u$1@mawar.singnet.com.sg>,
: "Mr. Ken" <Mr.Ken@novice.com> wrote:
:> Does it mean that Exceed uses PC's time to update the time of my
:> modified files on Unix server?

: It sure looks like it. That's the only likely explanation for the files
: having timestamps in the future.

My guess would be that the Unix server has an NFS mounted file
system, and the NFS server's clock is 15 minutes in the future.

Try this:

date
touch .this /tmp/.that
ls -l .this /tmp/.that
df -k .

The last one only to see if it is an NFS mounted fs.

james
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com