Re: timestamp of files in perl

2002-05-11 Thread drieux


On Tuesday, May 7, 2002, at 09:15 , Nikola Janceski wrote:
[..]
> The factual part, I could do a system call and 'touch' the links to the 
> time
> I want. But I was hoping for a perl way of doing that.
[..]

this could be a 'semantic' issue - and I am jack rabbitting on
the token 'link' here - but lets rule out the obvious first.

lets try this another way.

the case of 'hard links'.

vladimir: 62:] ls -li bob frodo
frodo: No such file or directory
  237948538 -rw-r--r--   1 drieux   house134 May  2 17:49 bob
vladimir: 63:] ln bob frodo
vladimir: 64:] ls -li bob frodo
  237948538 -rw-r--r--   2 drieux   house134 May  2 17:49 bob
  237948538 -rw-r--r--   2 drieux   house134 May  2 17:49 frodo
vladimir: 65:] touch frodo
vladimir: 66:] !ls
ls -li bob frodo
  237948538 -rw-r--r--   2 drieux   house134 May 11 16:53 bob
  237948538 -rw-r--r--   2 drieux   house134 May 11 16:53 frodo
vladimir: 67:]

note that since there is only one inode in the 'file table'
and it just happens to have two 'name' entries in the 'file table'

what occurs is that the 'file' got updated.

we notice that the problem with 'symbolic links' is that they
do not change - because the system wanders through and does
the 'touch' on the file it is linked to.

vladimir: 68:] ls -l hom* ind*
lrwxrwxrwx   1 drieux   house 10 Jan 28 20:43 home.html -> 
index.html
-rwxr--r--   1 drieux   house  13627 May 11 16:51 index.html
vladimir: 69:] touch home.html
vladimir: 70:] ls -l hom* ind*
lrwxrwxrwx   1 drieux   house 10 Jan 28 20:43 home.html -> 
index.html
-rwxr--r--   1 drieux   house  13627 May 11 16:55 index.html
vladimir: 71:]

that being clarified - why in GOD's Little Green Earth are
we trying to set the 'time' to being older

vladimir: 93:] ls -ld DTV index.html
drwxr-xr-x   2 drieux   house   4096 Jul 12  1997 DTV
-rwxr--r--   1 drieux   house  13627 May 11 16:55 index.html
vladimir: 94:] touch -r DTV index.html
vladimir: 95:] ls -ld DTV index.html
drwxr-xr-x   2 drieux   house   4096 Jul 12  1997 DTV
-rwxr--r--   1 drieux   house  13627 Jul 12  1997 index.html
vladimir: 96:]

that a thing can be done does not clearly lead one to need to do it???


ciao
drieux

---


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: timestamp of files in perl

2002-05-07 Thread Nikola Janceski



> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 07, 2002 12:04 PM
> To: Nikola Janceski
> Cc: [EMAIL PROTECTED]
> Subject: Re: timestamp of files in perl
> 
> 
> >>>>> "Nikola" == Nikola Janceski 
> <[EMAIL PROTECTED]> writes:
> 
> Nikola> I find that hard to swallow.
> 
> What part of "that" are you referencing?  The factual part?
> Or my strongly stated opinion?

The factual part, I could do a system call and 'touch' the links to the time
I want.
But I was hoping for a perl way of doing that.

> 
> Nikola>  A solution would make my work much easier.
> 
> A solution to what?  The API isn't provided, because it isn't needed!

I was just stating why I was in search of solution.

> 
> Nikola> I wish more developers have your outlook on 
> programming, but it's too bad
> Nikola> management doesn't "get it" sometimes.
> 
> It's up to us *as programmers* to clearly inform management 
> what is and
> isn't possible, and more importantly, what is and is not maintainable.
> 
> Most of the money spent on software is spent on 
> *maintenance*.  However,
> most managers don't have maintenance as a priority.  How tragic.

Agreed, but saying, "it can't be done", can get a response, "if you can't do
it we'll find someone else that will". I think communication and rules need
to be inacted, but I don't think anyone would follow them. :)

> 
> -- 
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - 
> +1 503 777 0095
> <[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/>
> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> See PerlTraining.Stonehenge.com for onsite and 
> open-enrollment Perl training!
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: timestamp of files in perl

2002-05-07 Thread Randal L. Schwartz

> "Nikola" == Nikola Janceski <[EMAIL PROTECTED]> writes:

Nikola> I find that hard to swallow.

What part of "that" are you referencing?  The factual part?
Or my strongly stated opinion?

Nikola>  A solution would make my work much easier.

A solution to what?  The API isn't provided, because it isn't needed!

Nikola> I wish more developers have your outlook on programming, but it's too bad
Nikola> management doesn't "get it" sometimes.

It's up to us *as programmers* to clearly inform management what is and
isn't possible, and more importantly, what is and is not maintainable.

Most of the money spent on software is spent on *maintenance*.  However,
most managers don't have maintenance as a priority.  How tragic.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: timestamp of files in perl

2002-05-07 Thread Randal L. Schwartz

> "Nikola" == Nikola Janceski <[EMAIL PROTECTED]> writes:

Nikola> I have created a perl script that symbolicly links directory
Nikola> sturctures.  I wish to change the modification timestamp of
Nikola> the link, but I can't find a function that does so.

Nikola> Anyone know of a method in perl to change the timestamp of
Nikola> link so it looks OLDER?

The permissions, ownership, and timestamps on a symbolic link are
never referenced by the Unix Kernel.  Thus, no API is provided to make
changes to the useless values.

*Applications* which look at the non-referenced information should
be deleted, and the programmers who write such bad software should
be hung up, shot, then burned at the stake.  (*cough* Apache *cough*)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




timestamp of files in perl

2002-05-07 Thread Nikola Janceski

I have created a perl script that symbolicly links directory sturctures.
I wish to change the modification timestamp of the link, but I can't find a
function that does so.

Anyone know of a method in perl to change the timestamp of link so it looks
OLDER?



Delivery Queue


Nikola Janceski
Summit Systems, Inc.
212-896-3400

You can pretend to be serious; you can't pretend to be witty.  
-- Sacha Guitry (1885-1957)  




The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]