File Find Question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ralph Freshour

    File Find Question

    I looked in the manual and searched the web but did not see a file
    find function that takes a wild card - I need to look for all files
    such as:

    $Array = FileFind('name_ *.jpg');

    And then I need to delete all such files.

    Is there such a function?

    Thanks...

  • David Robley

    #2
    Re: File Find Question

    In article <4fnilv0ial659c k37sil9kps6tiid pehj7@4ax.com>,
    ralph@primemail .com says...[color=blue]
    > I looked in the manual and searched the web but did not see a file
    > find function that takes a wild card - I need to look for all files
    > such as:
    >
    > $Array = FileFind('name_ *.jpg');
    >
    > And then I need to delete all such files.
    >
    > Is there such a function?
    >
    > Thanks...[/color]

    Check out opendir() and readdir() - you'll need to write your own routine
    to read files, but there is an example in the docs which almost does what
    you want, IIRC. And to delete files, see unlink()

    Cheers
    --
    Quod subigo farinam

    $email =~ s/oz$/au/o;
    A: Because it messes up the order in which people normally read text.
    Q: Why is top-posting such a bad thing?
    A: Top-posting.
    Q: What is the most annoying thing on usenet?

    Comment

    • Adam i Agnieszka Gasiorowski FNORD

      #3
      Re: File Find Question

      Ralph Freshour wrote:
      [color=blue]
      > I looked in the manual and searched the web but did not see a file
      > find function that takes a wild card - I need to look for all files
      > such as:
      >
      > $Array = FileFind('name_ *.jpg');
      >
      > And then I need to delete all such files.
      >
      > Is there such a function?[/color]

      Try searching for 'glob' in the manual.

      --
      Seks, seksiæ, seksolatki... news:pl.soc.sek s.moderowana
      http://hyperreal.info { iWanToDie } WiNoNa ) (
      http://szatanowskie-ladacznice.0-700.pl foReVeR( * )
      Poznaj jej zwiewne kszta³ty... http://www.opera.com 007

      Comment

      Working...