three quick questions 
Author Message
 three quick questions

Like I said, three quick questions:

1. I see from integer.pm that $^H is used to set integer mode, but where is
   this documented?

2. Why can't I use the -s flag to set special variables, like
        perl -se 'print 1,2,3' -- -,=:

3. Is there a way (in Perl OR unix) to set the inode change time of a
   file to a given value (like utime does for atime and mtime)?

TIA,

John



Wed, 09 Jul 1997 03:14:43 GMT  
 three quick questions

Quote:

>3. Is there a way (in Perl OR unix) to set the inode change time of a
>   file to a given value (like utime does for atime and mtime)?

Unix provides no such mechanism (other that a privileged user writing
directly to the disk), so there's no way Perl could do it.  This is
intentional -- checking the inode change time is the way you can detect if
someone forged the modification time.
--

Barry Margolin
BBN Internet Services Corp.



Thu, 10 Jul 1997 01:10:33 GMT  
 three quick questions

John> Like I said, three quick questions:

And three somewhat correct answers. :-)

John> 1. I see from integer.pm that $^H is used to set integer mode, but where is
John>    this documented?

In the source.  It's not for external mungling (I guess), just use the
published interface to it "use integer...";

John> 2. Why can't I use the -s flag to set special variables, like
John>        perl -se 'print 1,2,3' -- -,=:

Probably because they don't look alphanumeric.

John> 3. Is there a way (in Perl OR unix) to set the inode change time of a
John>    file to a given value (like utime does for atime and mtime)?

You are *always* setting the ctime to *now* everytime you update the
file data or meta-data.  So, ctime would have to become *now* the
moment you *set* ctime. :-)

But no, there's no interface to change the ctime to an arbitrary time.
Why do you care?  It's just a backup flag -- and you wouldn't want to
mess up a backup.

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)

--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying

Web: <A HREF="http://www.teleport.com/~merlyn/">My Home Page!</A>



Thu, 10 Jul 1997 22:58:09 GMT  
 three quick questions
: Like I said, three quick questions:

I'll give you three quick answers.

: 1. I see from integer.pm that $^H is used to set integer mode, but where is
:    this documented?

No place. [1]

: 2. Why can't I use the -s flag to set special variables, like
:       perl -se 'print 1,2,3' -- -,=:

No reason. [2]

: 3. Is there a way (in Perl OR unix) to set the inode change time of a
:    file to a given value (like utime does for atime and mtime)?

No way. [3]

Larry

[1] It's undocumented for a reason--it's an internal implementation
detail that could change at any time.  The documented interface is
"use integer".

[2] It just seemed to write itself that way.  Chalk it up to latent
fascist tendencies.

[3] This is part of the design of Unix.  Strictly speaking, there
*is* a way, but you'd have to open up the raw disk partition while
the filesystem was unmounted, find the correct word on the disk
and twiddle it.  Not for the weakminded, or the permissionally
challenged.



Sun, 13 Jul 1997 01:45:32 GMT  
 three quick questions

Quote:

>>3. Is there a way (in Perl OR unix) to set the inode change time of a
>>   file to a given value (like utime does for atime and mtime)?
>Unix provides no such mechanism (other that a privileged user writing
>directly to the disk)

An easier technique for that privileged user is to change the system
clock, chmod the file to its current mode, and correct the system clock.
(And remove the log entries recording the clock change.)

Quote:
>, so there's no way Perl could do it.  This is
>intentional -- checking the inode change time is the way you can detect if
>someone forged the modification time.

The inode change time of most of my files is the time my files were moved
to another partition.  The modification times were changed to match those
on the partition my files came from.  I wouldn't call that forging.  This
is what "utime" is for.

--
HansM



Sun, 13 Jul 1997 01:45:12 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. three perl questions for the experts

2. PUZZLE: Answer me these questions three

3. Three questions related to SNMP, external task handling, paralell tasking

4. Three questions about Selena Sol's Database Manager

5. start of a quick perl5a5 quick reference

6. Quick POD Question:

7. quick question about installing perl modules

8. Quick Question about split

9. Quick Question

10. 2 quick questions

11. Quick newbie question.

12. Quick question - prompt3 (tcsh utility in perlscript)

 

 
Powered by phpBB® Forum Software