Coder Social home page Coder Social logo

glob's Introduction

Glob

Build Status

Glob is a simple cross-platform wrapper around system APIs for finding files based on patterns.

Below is an example program:

#include <iostream>
#include "glob.h"

int main(int argc, char **argv) {
    if (argc < 2) {
        std::cerr << "Usage: " << argv[0] << " pattern1 [pattern2 [...]]"
                  << std::endl;
        return 1;
    }
    for (int i = 1; i < argc; i++) {
        glob::glob glob(argv[i]);
        while (glob) {
            std::cout << glob.current_match() << std::endl;
            glob.next();
        }
    }
}

TODO

  • Custom glob parser with identical behavior across platforms

glob's People

Contributors

sryze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

mskalski

glob's Issues

doesn't compile on Windows with UNICODE enabled

If you have UNICODE #defined, then glob.cpp doesn't compile.

You are calling FindFirstFileA (ASCII-only) with a struct of type WIN32_FIND_DATA, which is Unicode or ASCII depending on whether UNICODE is #defined or not.

If you make find_data_ of type WIN32_FIND_DATAA instead it compiles.

eats paths

I would expect glob("/path/*") to return all the elements with the "/path/" prefix included, but they aren't. This is different to how glob.glob() behaves in Python for example.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.