Loading ...
Sorry, an error occurred while loading the content.

[PBML] Re: Virus programming

Expand Messages
  • acummingsus
    ... Oops. That was a (help) note to myself (as a reminder, merely of the potential for danger). You re right of course. I forgot to edit when I posted to
    Message 1 of 11 , Jan 31, 2006
    • 0 Attachment
      --- In perl-beginner@yahoogroups.com, merlyn@s... wrote:
      >
      > >>>>> "acummingsus" == acummingsus <acelists@g...> writes:
      >
      > acummingsus> sends a dir tree to /dev/null -USE CAUTION-
      >
      > Does not, but you probably don't care to know the difference.

      Oops. That was a (help) note to myself (as a reminder, merely of the
      potential for danger). You're right of course. I forgot to edit when
      I posted to list.

      I knew it didn't to /dev/null

      But I do know (as my experienced result anyways since it might not
      literally do this either) it goes to bit bucket somewhere, where I
      don't know nor do I know how to get it back or if it's even possible
      to get back.

      (I'm guessing that something *really* happens to either the inode(s)
      and/or the index_or_recording_or_what_keeps_track of the inodes)

      I actually would be interested in the difference. (I'm guessing that
      /dev/null is a null device)

      --
      Alan.
    • merlyn@stonehenge.com
      ... acummingsus (I m guessing that something *really* happens to either the inode(s) acummingsus and/or the index_or_recording_or_what_keeps_track of the
      Message 2 of 11 , Feb 1, 2006
      • 0 Attachment
        >>>>> "acummingsus" == acummingsus <acelists@...> writes:

        acummingsus> (I'm guessing that something *really* happens to either the inode(s)
        acummingsus> and/or the index_or_recording_or_what_keeps_track of the inodes)

        A directory contains a list of inodes associated with names in that directory.
        "rm -rf" does a depth-first removal of each directory entry by unlinking,
        which reduces the link count of each inode. (When the link count gets to 0,
        the data blocks belonging to the inode are also freed, and the inode itself is
        marked empty and available for re-use.) When the directory is empty, the
        parent directory is then scanned, until we get all the way to the top.

        Any open file will still be alive at the end of such a process (open files
        count toward the link count in a soft way), although not much else is going to
        happen once there are no more entries in the file system.

        acummingsus> I actually would be interested in the difference. (I'm guessing
        acummingsus> that /dev/null is a null device)

        The device normally mknod'ed to /dev/null returns "written successfully" for
        any bytes written, and "0" for number of bytes read (traditionally indicating
        EOF). Thus, it's for stream I/O only, and not for any disposal of files.

        --
        Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
        <merlyn@...> <URL: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!
      • Paul Archer
        Any suggestions here? Paul ... Q: What do Winnie-the-Pooh and John the Baptist have in common? A: Their middle name.
        Message 3 of 11 , Feb 2, 2006
        • 0 Attachment
          Any suggestions here?

          Paul

          Tuesday, Paul Archer wrote:

          >> try this at the prompt
          >>
          >>
          >> echo 49121642460476302043559655325609735240131249408713384930308013834P
          >> | dc
          >>
          >
          > This brings us back to Perl, with my attempt at a 'stupid DC tricks
          > generator':
          >
          > The problem is that strings longer than about eight characters produce values
          > that get represented in exponential notation. I've tried 'use integer', which
          > limits the size that the variable can be, and I've played around with printf
          > to no good effect.
          > So, how do you create really, really large integers in Perl without them
          > getting truncated, or binding C functions?
          >
          > echo 345232469002P | dc
          >
          >

          > #!/usr/bin/perl
          > use warnings;
          > use strict;
          > #use integer;
          >
          > print "gimme a string: ";
          > my $string=<STDIN>;
          > # no chomp 'cause we want the newline for the dc output
          > print "string is $string";
          >
          > our $total=0;
          >
          > foreach my $char (split //, $string){
          >
          > $total *=256;
          > $total += ord($char);
          > }
          >
          > print "total is $total\n";
          > printf "echo %luP | dc\n", $total;


          ----------------------------------------------------------------
          Q: What do Winnie-the-Pooh and John the Baptist have in common?
          A: Their middle name.
          ----------------------------------------------------------------
        Your message has been successfully submitted and would be delivered to recipients shortly.