mirror of
https://github.com/uutils/coreutils
synced 2024-11-15 17:28:03 +00:00
Replace unstable fs:walk_dir() w/ external crate.
This commit is contained in:
parent
6ff576e300
commit
f41d5b3f8f
3 changed files with 5 additions and 4 deletions
1
deps/Cargo.toml
vendored
1
deps/Cargo.toml
vendored
|
@ -20,3 +20,4 @@ unicode-width = "0.1.1"
|
||||||
winapi = "0.2"
|
winapi = "0.2"
|
||||||
advapi32-sys = "0.1"
|
advapi32-sys = "0.1"
|
||||||
kernel32-sys = "0.1"
|
kernel32-sys = "0.1"
|
||||||
|
walker = "^1.0.0"
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#![crate_name = "chmod"]
|
#![crate_name = "chmod"]
|
||||||
#![feature(fs_walk)]
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the uutils coreutils package.
|
* This file is part of the uutils coreutils package.
|
||||||
|
@ -18,14 +17,15 @@ extern crate libc;
|
||||||
extern crate memchr;
|
extern crate memchr;
|
||||||
extern crate regex;
|
extern crate regex;
|
||||||
extern crate regex_syntax;
|
extern crate regex_syntax;
|
||||||
|
extern crate walker;
|
||||||
|
|
||||||
use getopts::Options;
|
use getopts::Options;
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
use std::ffi::CString;
|
use std::ffi::CString;
|
||||||
use std::fs;
|
|
||||||
use std::io::{Error, Write};
|
use std::io::{Error, Write};
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
use walker::Walker;
|
||||||
|
|
||||||
#[path = "../common/util.rs"]
|
#[path = "../common/util.rs"]
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
@ -158,7 +158,7 @@ fn chmod(files: Vec<String>, changes: bool, quiet: bool, verbose: bool, preserve
|
||||||
if file.uu_is_dir() {
|
if file.uu_is_dir() {
|
||||||
if !preserve_root || filename != "/" {
|
if !preserve_root || filename != "/" {
|
||||||
if recursive {
|
if recursive {
|
||||||
let walk_dir = match fs::walk_dir(&file) {
|
let walk_dir = match Walker::new(&file) {
|
||||||
Ok(m) => m,
|
Ok(m) => m,
|
||||||
Err(f) => {
|
Err(f) => {
|
||||||
crash!(1, "{}", f.to_string());
|
crash!(1, "{}", f.to_string());
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
DEPLIBS += aho-corasick memchr regex regex-syntax
|
DEPLIBS += aho-corasick memchr regex regex-syntax walker
|
||||||
|
|
Loading…
Reference in a new issue