Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: System vs. User module version of List::Util

by marto (Archbishop)
on Jun 19, 2017 at 14:04 UTC ( #1193096=note: print w/replies, xml ) Need Help??


in reply to Re: System vs. User module version of List::Util
in thread System vs. User module version of List::Util

"Windows systems do not have an equivalent."

Apart from:

  • dir filename /s from the command prompt.
  • powershells get-childitem.
  • gnu find utils.
  • One of the many ports of locate available...

Don't feel compelled to reply to questions, none of your posts, advice or insights are helpful to anyone.

"If you are making these suggestions in earnest, please also include code or concrete applications in pseudo-code, instead of "scare quotes" around verbs to suggest that you are talking about programming. Leaving it to the seekers to interpret your posts in a helpful way does not in fact help them achieve their goals"

Replies are listed 'Best First'.
Re^3: System vs. User module version of List::Util
by afoken (Abbot) on Jun 19, 2017 at 20:18 UTC
    "Windows systems do not have an equivalent." Apart from:
    • dir filename /s from the command prompt.

    Well, as much as I hate it, but that's nonsense:

    locate uses a database (created by the companion program updatedb, see locatedb). That database contains a sorted and compressed list of filenames on the system optimized for searching for filenames.

    dir /s filename (on DOS/Windows) is a stupid tree scanner that has to read at least all directories starting at the current directory. It is roughly equivalent to find . -name filename.

    • powershells get-childitem

    That's also a stupid tree scanner, according to Microsoft

    • gnu find utils

    find is yet another stupid tree scanner. See GNU documentation. Apart from that, findutils contain locate, see above.

    • One of the many ports of locate available...

    Yeah, right. You could use locate on Windows. Like you could use it on Unix. With a database optimized for searching for filenames. Updated every now and then, and not always installed. Especially not installed on any "fresh" Windows installation. It is not even part of the installation media.

    Windows has an indexing service, optional for NT 4, standard since W2k, replaced with Windows Search indexer in Vista. But both index file names AND file contents, so they are not really comparable to locate. Yes, I'm aware that the newer one has a search API, but it looks quite scary. Maybe it's quite easy to implement something that has a command line interface similar to locate, but it is not available out-of-the-box. Plus, neiter the Indexing Service nor Windows Search index all local files. Directories outside Microsoft's plan for where you should store your data are not scanned by default.

    locate's updatedb can be configured by updatedb.conf, that file usually excludes virtual files, temp directories, and files on network shares and removable media. Directories outside the FHS are usually indexed. A sane updatedb.conf is usually bundled with locate when you use a binary or source distribution of Linux, and I'd expect the same for the BSDs.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

      Not sure if you've followed the thread, locate isn't avaiable. Consider equivelence as in equal in value. OP simply wanted to find files. Some of the alternatives listed are not as 'inteligent' as locate, however they do not rely on a database which may be stale, or may not be indexing, and will work.

      " Apart from that, findutils contain locate, see above."

      I know, that's why I linked to it.

        ... which may be stale, ...

        That's a fundamental, but common misconception you have there. The find view is similarly stale, it goes stale right after it has started while it's still running. It's just that the time window is much smaller.

Re^3: System vs. User module version of List::Util
by BrowserUk (Pope) on Jun 19, 2017 at 14:35 UTC
    dir filename /s from the command prompt.

    Or dir /s /b for more program friendly formatting. (Or attrib /s. It requires a little prefix trimming, but seems to run faster on uncached drives or trees.)


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
    In the absence of evidence, opinion is indistinguishable from prejudice. Suck that fhit
Re^3: System vs. User module version of List::Util
by Anonymous Monk on Jun 19, 2017 at 15:13 UTC
    Heh. As usual, sundial-servicer's "knowledge" is 30 years old.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1193096]
help
Chatterbox?
[choroba]: Good morning!

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2018-06-21 07:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (117 votes). Check out past polls.

    Notices?