{"id":16949507,"url":"https://github.com/tailhook/scan_dir","last_synced_at":"2025-04-11T20:20:24.638Z","repository":{"id":57666358,"uuid":"43073571","full_name":"tailhook/scan_dir","owner":"tailhook","description":"A easier read_dir for rust, useful for reading directory of config files","archived":false,"fork":false,"pushed_at":"2016-04-20T14:06:46.000Z","size":583,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-09T14:50:48.152Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tailhook.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-24T14:56:04.000Z","updated_at":"2017-10-12T07:07:05.000Z","dependencies_parsed_at":"2022-09-26T20:31:45.816Z","dependency_job_id":null,"html_url":"https://github.com/tailhook/scan_dir","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tailhook%2Fscan_dir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tailhook%2Fscan_dir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tailhook%2Fscan_dir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tailhook%2Fscan_dir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tailhook","download_url":"https://codeload.github.com/tailhook/scan_dir/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248473079,"owners_count":21109629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T21:55:04.820Z","updated_at":"2025-04-11T20:20:24.596Z","avatar_url":"https://github.com/tailhook.png","language":"Rust","readme":"========\nScan Dir\n========\n\n:Status: Beta\n:Documentation: http://tailhook.github.com/scan_dir/\n\nSimple interface to iterate over files or subdirs of a directory\n\nFeatures:\n\n1. Ensure that file names are decodable to utf-8\n   (or error/warning is propagated)\n2. Ignore hidden entries (by default)\n3. Ignore common text editor and revision control backup files\n4. Select only files or only directories\n5. Simpler but detailed enough error handling\n6. Recursive directory scanner\n\nHere is the example:\n\n.. code-block:: rust\n\n    use scan_dir::ScanDir;\n\n    ScanDir::dirs().read(\".\", |iter| {\n        for (entry, name) in iter {\n            println!(\"File {:?} has full path {:?}\", name, entry.path());\n        }\n    }).unwrap()\n\nCompare it to stdlib way:\n\n.. code-block:: rust\n\n    use std::fs::read_dir;\n    for entry_res in read_dir(\".\").unwrap() {\n        let entry = entry_res.unwrap();\n        let file_name_buf = entry.file_name();\n        let file_name = file_name_buf.to_str().unwrap();\n        if !file_name.starts_with(\".\") \u0026\u0026\n            entry.file_type().unwrap().is_dir()\n        {\n            println!(\"File {:?} has full path {:?}\",\n                file_name, entry.path());\n        }\n    }\n\nWell, it looks almost fine until you want to turn unwrap's into correct\nerror reporting.\n\n\nUpgrading\n=========\n\nThe ``scan_dir`` 0.3 by default resolves symlink before checking if it's a file\nor directory. In the ``scan_dir`` 0.1-0.2 symlinks where always included in the\nlist (i.e. they were skipped neither by ``skip_files`` nor by\n``skip_dirs``).\n\n\nLicense\n=======\n\nLicensed under either of\n\n * Apache License, Version 2.0, (./LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license (./LICENSE-MIT or http://opensource.org/licenses/MIT)\n\nat your option.\n\n\nContribution\n------------\n\nUnless you explicitly state otherwise, any contribution intentionally\nsubmitted for inclusion in the work by you, as defined in the Apache-2.0\nlicense, shall be dual licensed as above, without any additional terms or\nconditions.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftailhook%2Fscan_dir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftailhook%2Fscan_dir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftailhook%2Fscan_dir/lists"}