1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Finding files

Discussion in 'Support' started by vefatica, Aug 25, 2010.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,949
    Likes Received:
    30
    How do I search for files whose names match a regular expression? Can FFIND or DIR do it? Can TCMD's Edit\FindFiles?

    Whenever I start TCMD's Edit\FindFiles it starts with "V:\" (un-editable) in the upper right corner (regardless of the dir shown in the List View). Whenever I finish a search, that "V:\" comes back.

    I just put "*c:\*.log" in the "files" box and checked "dir and below". It has been searching (so it says) for 5 minutes, finding nothing yet (it should, that's my system drive). It still says "V:\" above the "files" box. I have an hourglass and the "Stop" button does nothing. Had to kill the "not responding" TCMD.

    Tried it again: Files: c:\*.log, Drives: (empty), "Dir and below" checked ... same as above.

    I can get it to find files in v:\. But when I search for "*.zip" with regular expressions and dir only checked (text box empty), it gives me 6 files with some extra garbage, like

    v:\sysutils.zip [0] PK(followed by three unprintables (boxes))
     
  2. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,949
    Likes Received:
    30
    Utterly reproducible: TCMD, Edit\FindFiles, Files: c:\*.log, Drives: (empty), "Dir and below" checked ... it hangs.
     
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,949
    Likes Received:
    30
    V11 does the same thing. I uploaded a snapshot of the dialog box ... well I tried ... it won't take a DOCX file or a 60KB DOC file
     
  4. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,856
    Likes Received:
    83
    That's invalid (or at least useless) syntax, but I'll check to see why it's
    hanging rather than just returning an error.

    Rex Conn
    JP Software
     
  5. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,949
    Likes Received:
    30
    Having read the help a couple of times, it still seems like the most likely syntax.

    "Enter the drive(s) you want to search in the Disks field. This field is ignored unless Entire Disk is selected in the Search portion of the dialog."

    So it would seem OK to clear the drives box. And I wanted to recurse so I checked "dir and below". What dir? Since there's no place to enter it, I put it in front of the file name (as I do with FFIND). What's wrong with that?

    Lets not be confused by the dir being a root.

    What's the correct way to find *.log in c:\windows and below?

    I just tried it (file: c:\windows\*.log, drives: (empty), "dir and below" checked) ... same hang as before.
     
  6. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,856
    Likes Received:
    83
    Yes, yes, and yes.


    I don't know what you're referring to -- there is no field displayed in the
    upper right corner of the Find dialog. (There is a field in the upper
    *left* corner, which is the current directory. Not editable, because, well,
    it's the current directory!)


    You apparently also removed the (required) value in the Drives field, which
    is what caused the hang. The files field should *not* contain drive specs.
    (This dialog is basically the same as what was in Take Command 1.0 15 years
    ago, so it's not likely to be radically changed at this point.)

    Rex Conn
    JP Software
     
  7. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,856
    Likes Received:
    83
    "\windows\*.log" in the filename field, "c" in the drives field. (It's
    always behaved this way; if you have problems with the syntax you should
    have spoken up 15 years ago!)

    Rex Conn
    JP Software
     
  8. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,949
    Likes Received:
    30
    How, how, How?

    I meant upper-left. What good is it to put TCMD's CWD there?

    The help says "drives" is ignored without "entire disk" checked.

    If I can't put the root of a recursive search in the "files" box, where can I put it?
     
  9. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,856
    Likes Received:
    83
    It's not garbage, it's the first matching line. In this case, you told it
    to search for .zip files, asked for regular expressions, and then didn't
    give it a regular expression -- so it wound up matching everything. It's
    displaying the filename, the first matching line (line 0 in this case,
    because you didn't provide a search string), and the text on that line
    (binary gibberish in this case).

    Rex Conn
    JP Software
     
  10. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,949
    Likes Received:
    30
    On Wed, 25 Aug 2010 23:32:16 -0400, rconn <>
    wrote:

    |---Quote---
    |> What's the correct way to find *.log in c:\windows and below?
    |---End Quote---
    |"\windows\*.log" in the filename field, "c" in the drives field. (It's
    |always behaved this way; if you have problems with the syntax you should
    |have spoken up 15 years ago!)

    Rarely use TCMD; used TakeCommand almost nil. If I had the occasion
    15 years ago I would have said that's lousy syntax (especially to one
    accustomed to FFIND).

    And I vaguely remembered something involving "::". Yes it works to
    give a file spec as a regex. But is it documented (where)? I
    couldn't find it. It should be PROMINENTLY documented, say (for DIR)
    here:

    Supports extended wildcards, ranges, multiple file names, and include
    lists. [AND REGULAR EXPRESSIONS}

    and more thoroughly under "Selecting Files", and similarly for FFIND
    and any other command which supports regex filename specs.
     
  11. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,856
    Likes Received:
    83
    Are you trying to search using RE's in the filename, or are you trying to
    search the contents of the files using RE's?

    The former is handled the same way every file handling command does it, by
    inserting "::" before the filename. (See "Wildcards" in the help.)

    The latter varies depending on what command you're using (FFIND /E, or by
    selecting "Regular Expressions" in the Find Dialog and then entering the RE
    in the text search field.)


    Because that's where the default searches start, and it's overwritten with
    the current search directory while the search is executing, so you can
    monitor its progress.

    Rex Conn
    JP Software
     
  12. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,856
    Likes Received:
    83
    You can put the root (or even the disk spec) in the files field, but you
    cannot delete the disks field. (Even if it's not being used, it doesn't
    expect to be empty, which is what is causing your hang.)

    Rex Conn
    JP Software
     
  13. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,856
    Likes Received:
    83
    That's exactly where it's (already documented) -- in "wildcards".

    Rex Conn
    JP Software
     
  14. samintz

    samintz Scott Mintz

    Joined:
    May 20, 2008
    Messages:
    1,189
    Likes Received:
    11
    Not that this answers your question, but have you tried the Everything
    Search plugin I created? It is blazingly fast and free (my favorite
    price).

    Everything Search: http://www.voidtools.com

    Plugin:
    http://jpsoft.com/forums/attachment.php?attachmentid=139&d=1275944783

    -Scott

    vefatica <> wrote on 08/25/2010 09:28:30 PM:


     

Share This Page