diff --git a/dev/search-index.js b/dev/search-index.js index d32aeeb68..c9b5d4447 100644 --- a/dev/search-index.js +++ b/dev/search-index.js @@ -106,9 +106,9 @@ var searchIndex = JSON.parse('{\ "uu_basenc":{"doc":"","t":[5,5],"n":["uu_app","uumain"],"q":["uu_basenc",""],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ "uu_cat":{"doc":"","t":[5,5],"n":["uu_app","uumain"],"q":["uu_cat",""],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ "uu_chcon":{"doc":"","t":[0,5,5,7,7,7,7,7,7,7,7,0,0,0,7,7,7,7,7,7,7],"n":["options","uu_app","uumain","HELP","RANGE","RECURSIVE","REFERENCE","ROLE","TYPE","USER","VERBOSE","dereference","preserve_root","sym_links","DEREFERENCE","NO_DEREFERENCE","NO_PRESERVE_ROOT","PRESERVE_ROOT","FOLLOW_ARG_DIR_SYM_LINK","FOLLOW_DIR_SYM_LINKS","NO_FOLLOW_SYM_LINKS"],"q":["uu_chcon","","","uu_chcon::options","","","","","","","","","","","uu_chcon::options::dereference","","uu_chcon::options::preserve_root","","uu_chcon::options::sym_links","",""],"d":["","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"f":[0,[[],1],[2,3],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_chgrp":{"doc":"","t":[0,5,5,3,8,3,11,11,11,11,11,11,11,11,11,11,11,11,11,5,5,12,12,5,5,11,11,10,11,11,11,11,12,12,11,11,11,11,11,11,11,11,12,5,12,12,12,12,5],"n":["entries","uu_app","uumain","Group","Locate","Passwd","belongs_to","borrow","borrow","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","fmt","fmt","from","from","get_groups","get_groups_gnu","gid","gid","gid2grp","grp2gid","into","into","locate","locate","locate","locate","locate","name","name","to_owned","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","uid","uid2usr","user_dir","user_info","user_passwd","user_shell","usr2uid"],"q":["uu_chgrp","","","uu_chgrp::entries","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["Get password/group file entry","","","","Fetch desired entry.","","This is a wrapper function for libc::getgrouplist.","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","From: …","The list of group IDs returned from GNU’s groups and GNU…","AKA passwd.pw_gid","AKA group.gr_gid","","","Calls U::from(self).","Calls U::from(self).","","","","","","AKA passwd.pw_name","AKA group.gr_name","","","","","","","","","AKA passwd.pw_uid","","AKA passwd.pw_dir","AKA passwd.pw_gecos","AKA passwd.pw_passwd","AKA passwd.pw_shell",""],"i":[0,0,0,0,0,0,4,4,8,4,8,4,8,4,8,4,8,4,8,0,0,4,8,0,0,4,8,17,4,4,8,8,4,8,4,8,4,8,4,8,4,8,4,0,4,4,4,4,0],"f":[0,[[],1],[2,3],0,0,0,[4,[[7,[5,6]]]],[[]],[[]],[[]],[[]],[4,4],[8,8],[[]],[[]],[[4,9],[[11,[10]]]],[[8,9],[[11,[10]]]],[[]],[[]],[[],[[11,[[7,[5,6]],12]]]],[[[13,[5]]],[[11,[[7,[5,6]],12]]]],0,0,[5,[[11,[14,12]]]],[15,[[11,[5,12]]]],[[]],[[]],[[],[[11,[12]]]],[5,[[11,[4,12]]]],[15,[[11,[4,12]]]],[15,[[11,[8,12]]]],[5,[[11,[8,12]]]],0,0,[[]],[[]],[[],11],[[],11],[[],11],[[],11],[[],16],[[],16],0,[5,[[11,[14,12]]]],0,0,0,0,[15,[[11,[5,12]]]]],"p":[[3,"Command"],[8,"Args"],[15,"i32"],[3,"Passwd"],[15,"u32"],[3,"Global"],[3,"Vec"],[3,"Group"],[3,"Formatter"],[3,"Error"],[4,"Result"],[3,"Error"],[4,"Option"],[3,"String"],[15,"str"],[3,"TypeId"],[8,"Locate"]]},\ +"uu_chgrp":{"doc":"","t":[0,5,5,3,8,3,11,11,11,11,11,11,11,11,11,11,11,11,11,5,5,12,12,5,5,11,11,10,11,11,11,11,12,12,11,11,11,11,11,11,11,11,12,5,12,12,12,12,5],"n":["entries","uu_app","uumain","Group","Locate","Passwd","belongs_to","borrow","borrow","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","fmt","fmt","from","from","get_groups","get_groups_gnu","gid","gid","gid2grp","grp2gid","into","into","locate","locate","locate","locate","locate","name","name","to_owned","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","uid","uid2usr","user_dir","user_info","user_passwd","user_shell","usr2uid"],"q":["uu_chgrp","","","uu_chgrp::entries","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["Get password/group file entry","","","","Fetch desired entry.","","This is a wrapper function for libc::getgrouplist.","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","From: …","The list of group IDs returned from GNU’s groups and GNU…","AKA passwd.pw_gid","AKA group.gr_gid","","","Calls U::from(self).","Calls U::from(self).","","","","","","AKA passwd.pw_name","AKA group.gr_name","","","","","","","","","AKA passwd.pw_uid","","AKA passwd.pw_dir","AKA passwd.pw_gecos","AKA passwd.pw_passwd","AKA passwd.pw_shell",""],"i":[0,0,0,0,0,0,4,4,8,4,8,4,8,4,8,4,8,4,8,0,0,4,8,0,0,4,8,17,4,4,8,8,4,8,4,8,4,8,4,8,4,8,4,0,4,4,4,4,0],"f":[0,[[],1],[2,3],0,0,0,[4,[[7,[5,6]]]],[[]],[[]],[[]],[[]],[4,4],[8,8],[[]],[[]],[[4,9],[[11,[10]]]],[[8,9],[[11,[10]]]],[[]],[[]],[[],[[11,[[7,[5,6]],12]]]],[[[13,[5]]],[[11,[[7,[5,6]],12]]]],0,0,[5,[[11,[14,12]]]],[15,[[11,[5,12]]]],[[]],[[]],[[],[[11,[12]]]],[15,[[11,[4,12]]]],[5,[[11,[4,12]]]],[15,[[11,[8,12]]]],[5,[[11,[8,12]]]],0,0,[[]],[[]],[[],11],[[],11],[[],11],[[],11],[[],16],[[],16],0,[5,[[11,[14,12]]]],0,0,0,0,[15,[[11,[5,12]]]]],"p":[[3,"Command"],[8,"Args"],[15,"i32"],[3,"Passwd"],[15,"u32"],[3,"Global"],[3,"Vec"],[3,"Group"],[3,"Formatter"],[3,"Error"],[4,"Result"],[3,"Error"],[4,"Option"],[3,"String"],[15,"str"],[3,"TypeId"],[8,"Locate"]]},\ "uu_chmod":{"doc":"","t":[5,5],"n":["uu_app","uumain"],"q":["uu_chmod",""],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_chown":{"doc":"","t":[3,8,3,11,11,11,11,11,11,11,11,11,0,11,11,11,11,12,12,11,11,10,11,11,11,11,12,12,11,11,11,11,11,11,11,11,12,12,12,12,12,5,5,3,8,3,5,5,12,12,5,5,10,12,12,12,5,12,12,12,12,5],"n":["Group","Locate","Passwd","belongs_to","borrow","borrow","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","entries","fmt","fmt","from","from","gid","gid","into","into","locate","locate","locate","locate","locate","name","name","to_owned","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","uid","user_dir","user_info","user_passwd","user_shell","uu_app","uumain","Group","Locate","Passwd","get_groups","get_groups_gnu","gid","gid","gid2grp","grp2gid","locate","name","name","uid","uid2usr","user_dir","user_info","user_passwd","user_shell","usr2uid"],"q":["uu_chown","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","uu_chown::entries","","","","","","","","","","","","","","","","","",""],"d":["","Fetch desired entry.","","This is a wrapper function for libc::getgrouplist.","","","","","","","","","Get password/group file entry","","","Returns the argument unchanged.","Returns the argument unchanged.","AKA passwd.pw_gid","AKA group.gr_gid","Calls U::from(self).","Calls U::from(self).","","","","","","AKA passwd.pw_name","AKA group.gr_name","","","","","","","","","AKA passwd.pw_uid","AKA passwd.pw_dir","AKA passwd.pw_gecos","AKA passwd.pw_passwd","AKA passwd.pw_shell","","","","Fetch desired entry.","","From: …","The list of group IDs returned from GNU’s groups and GNU…","AKA passwd.pw_gid","AKA group.gr_gid","","","","AKA passwd.pw_name","AKA group.gr_name","AKA passwd.pw_uid","","AKA passwd.pw_dir","AKA passwd.pw_gecos","AKA passwd.pw_passwd","AKA passwd.pw_shell",""],"i":[0,0,0,1,1,5,1,5,1,5,1,5,0,1,5,1,5,1,5,1,5,17,1,1,5,5,1,5,1,5,1,5,1,5,1,5,1,1,1,1,1,0,0,0,0,0,0,0,1,5,0,0,17,1,5,1,0,1,1,1,1,0],"f":[0,0,0,[1,[[4,[2,3]]]],[[]],[[]],[[]],[[]],[1,1],[5,5],[[]],[[]],0,[[1,6],[[8,[7]]]],[[5,6],[[8,[7]]]],[[]],[[]],0,0,[[]],[[]],[[],[[8,[9]]]],[2,[[8,[1,9]]]],[10,[[8,[1,9]]]],[2,[[8,[5,9]]]],[10,[[8,[5,9]]]],0,0,[[]],[[]],[[],8],[[],8],[[],8],[[],8],[[],11],[[],11],0,0,0,0,0,[[],12],[13,14],0,0,0,[[],[[8,[[4,[2,3]],9]]]],[[[15,[2]]],[[8,[[4,[2,3]],9]]]],0,0,[2,[[8,[16,9]]]],[10,[[8,[2,9]]]],[[],[[8,[9]]]],0,0,0,[2,[[8,[16,9]]]],0,0,0,0,[10,[[8,[2,9]]]]],"p":[[3,"Passwd"],[15,"u32"],[3,"Global"],[3,"Vec"],[3,"Group"],[3,"Formatter"],[3,"Error"],[4,"Result"],[3,"Error"],[15,"str"],[3,"TypeId"],[3,"Command"],[8,"Args"],[15,"i32"],[4,"Option"],[3,"String"],[8,"Locate"]]},\ +"uu_chown":{"doc":"","t":[3,8,3,11,11,11,11,11,11,11,11,11,0,11,11,11,11,12,12,11,11,10,11,11,11,11,12,12,11,11,11,11,11,11,11,11,12,12,12,12,12,5,5,3,8,3,5,5,12,12,5,5,10,12,12,12,5,12,12,12,12,5],"n":["Group","Locate","Passwd","belongs_to","borrow","borrow","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","entries","fmt","fmt","from","from","gid","gid","into","into","locate","locate","locate","locate","locate","name","name","to_owned","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","uid","user_dir","user_info","user_passwd","user_shell","uu_app","uumain","Group","Locate","Passwd","get_groups","get_groups_gnu","gid","gid","gid2grp","grp2gid","locate","name","name","uid","uid2usr","user_dir","user_info","user_passwd","user_shell","usr2uid"],"q":["uu_chown","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","uu_chown::entries","","","","","","","","","","","","","","","","","",""],"d":["","Fetch desired entry.","","This is a wrapper function for libc::getgrouplist.","","","","","","","","","Get password/group file entry","","","Returns the argument unchanged.","Returns the argument unchanged.","AKA passwd.pw_gid","AKA group.gr_gid","Calls U::from(self).","Calls U::from(self).","","","","","","AKA passwd.pw_name","AKA group.gr_name","","","","","","","","","AKA passwd.pw_uid","AKA passwd.pw_dir","AKA passwd.pw_gecos","AKA passwd.pw_passwd","AKA passwd.pw_shell","","","","Fetch desired entry.","","From: …","The list of group IDs returned from GNU’s groups and GNU…","AKA passwd.pw_gid","AKA group.gr_gid","","","","AKA passwd.pw_name","AKA group.gr_name","AKA passwd.pw_uid","","AKA passwd.pw_dir","AKA passwd.pw_gecos","AKA passwd.pw_passwd","AKA passwd.pw_shell",""],"i":[0,0,0,1,1,5,1,5,1,5,1,5,0,1,5,1,5,1,5,1,5,17,1,1,5,5,1,5,1,5,1,5,1,5,1,5,1,1,1,1,1,0,0,0,0,0,0,0,1,5,0,0,17,1,5,1,0,1,1,1,1,0],"f":[0,0,0,[1,[[4,[2,3]]]],[[]],[[]],[[]],[[]],[1,1],[5,5],[[]],[[]],0,[[1,6],[[8,[7]]]],[[5,6],[[8,[7]]]],[[]],[[]],0,0,[[]],[[]],[[],[[8,[9]]]],[10,[[8,[1,9]]]],[2,[[8,[1,9]]]],[2,[[8,[5,9]]]],[10,[[8,[5,9]]]],0,0,[[]],[[]],[[],8],[[],8],[[],8],[[],8],[[],11],[[],11],0,0,0,0,0,[[],12],[13,14],0,0,0,[[],[[8,[[4,[2,3]],9]]]],[[[15,[2]]],[[8,[[4,[2,3]],9]]]],0,0,[2,[[8,[16,9]]]],[10,[[8,[2,9]]]],[[],[[8,[9]]]],0,0,0,[2,[[8,[16,9]]]],0,0,0,0,[10,[[8,[2,9]]]]],"p":[[3,"Passwd"],[15,"u32"],[3,"Global"],[3,"Vec"],[3,"Group"],[3,"Formatter"],[3,"Error"],[4,"Result"],[3,"Error"],[15,"str"],[3,"TypeId"],[3,"Command"],[8,"Args"],[15,"i32"],[4,"Option"],[3,"String"],[8,"Locate"]]},\ "uu_chroot":{"doc":"","t":[5,5],"n":["uu_app","uumain"],"q":["uu_chroot",""],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ "uu_cksum":{"doc":"","t":[5,5],"n":["uu_app","uumain"],"q":["uu_cksum",""],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ "uu_comm":{"doc":"","t":[5,5],"n":["uu_app","uumain"],"q":["uu_comm",""],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ diff --git a/dev/src/uu_dd/dd.rs.html b/dev/src/uu_dd/dd.rs.html index 80b6f30d3..d4df39db3 100644 --- a/dev/src/uu_dd/dd.rs.html +++ b/dev/src/uu_dd/dd.rs.html @@ -1022,7 +1022,6 @@ 1022 1023 1024 -1025
// This file is part of the uutils coreutils package.
 //
 // (c) Tyler Steele <tyler.steele@protonmail.com>
@@ -1163,7 +1162,7 @@
 ///
 /// Use the [`Input::new_stdin`] or [`Input::new_file`] functions to
 /// construct a new instance of this struct. Then pass the instance to
-/// the [`Output::dd_out`] function to execute the main copy operation
+/// the [`dd_copy`] function to execute the main copy operation
 /// for `dd`.
 struct Input<'a> {
     /// The source from which bytes will be read.
@@ -1474,7 +1473,7 @@
 ///
 /// Use the [`Output::new_stdout`] or [`Output::new_file`] functions
 /// to construct a new instance of this struct. Then use the
-/// [`Output::dd_out`] function to execute the main copy operation for
+/// [`dd_copy`] function to execute the main copy operation for
 /// `dd`.
 struct Output<'a> {
     /// The destination to which bytes will be written.
@@ -1604,136 +1603,135 @@
             Ok(())
         }
     }
+}
 
-    /// Copy the given input data to this output, consuming both.
-    ///
-    /// This method contains the main loop for the `dd` program. Bytes
-    /// are read in blocks from `i` and written in blocks to this
-    /// output. Read/write statistics are reported to stderr as
-    /// configured by the `status` command-line argument.
-    ///
-    /// # Errors
-    ///
-    /// If there is a problem reading from the input or writing to
-    /// this output.
-    fn dd_out(mut self, mut i: Input) -> std::io::Result<()> {
-        // The read and write statistics.
+/// Copy the given input data to this output, consuming both.
+///
+/// This method contains the main loop for the `dd` program. Bytes
+/// are read in blocks from `i` and written in blocks to this
+/// output. Read/write statistics are reported to stderr as
+/// configured by the `status` command-line argument.
+///
+/// # Errors
+///
+/// If there is a problem reading from the input or writing to
+/// this output.
+fn dd_copy(mut i: Input, mut o: Output) -> std::io::Result<()> {
+    // The read and write statistics.
+    //
+    // These objects are counters, initialized to zero. After each
+    // iteration of the main loop, each will be incremented by the
+    // number of blocks read and written, respectively.
+    let mut rstat = ReadStat::default();
+    let mut wstat = WriteStat::default();
+
+    // The time at which the main loop starts executing.
+    //
+    // When `status=progress` is given on the command-line, the
+    // `dd` program reports its progress every second or so. Part
+    // of its report includes the throughput in bytes per second,
+    // which requires knowing how long the process has been
+    // running.
+    let start = time::Instant::now();
+
+    // A good buffer size for reading.
+    //
+    // This is an educated guess about a good buffer size based on
+    // the input and output block sizes.
+    let bsize = calc_bsize(i.settings.ibs, o.settings.obs);
+
+    // Start a thread that reports transfer progress.
+    //
+    // The `dd` program reports its progress after every block is written,
+    // at most every 1 second, and only if `status=progress` is given on
+    // the command-line or a SIGUSR1 signal is received. We
+    // perform this reporting in a new thread so as not to take
+    // any CPU time away from the actual reading and writing of
+    // data. We send a `ProgUpdate` from the transmitter `prog_tx`
+    // to the receives `rx`, and the receiver prints the transfer
+    // information.
+    let (prog_tx, rx) = mpsc::channel();
+    let output_thread = thread::spawn(gen_prog_updater(rx, i.settings.status));
+    let mut progress_as_secs = 0;
+
+    // Optimization: if no blocks are to be written, then don't
+    // bother allocating any buffers.
+    if let Some(Num::Blocks(0) | Num::Bytes(0)) = i.settings.count {
+        return finalize(&mut o, rstat, wstat, start, &prog_tx, output_thread);
+    };
+
+    // Create a common buffer with a capacity of the block size.
+    // This is the max size needed.
+    let mut buf = vec![BUF_INIT_BYTE; bsize];
+
+    // The main read/write loop.
+    //
+    // Each iteration reads blocks from the input and writes
+    // blocks to this output. Read/write statistics are updated on
+    // each iteration and cumulative statistics are reported to
+    // the progress reporting thread.
+    while below_count_limit(&i.settings.count, &rstat, &wstat) {
+        // Read a block from the input then write the block to the output.
         //
-        // These objects are counters, initialized to zero. After each
-        // iteration of the main loop, each will be incremented by the
-        // number of blocks read and written, respectively.
-        let mut rstat = ReadStat::default();
-        let mut wstat = WriteStat::default();
-
-        // The time at which the main loop starts executing.
-        //
-        // When `status=progress` is given on the command-line, the
-        // `dd` program reports its progress every second or so. Part
-        // of its report includes the throughput in bytes per second,
-        // which requires knowing how long the process has been
-        // running.
-        let start = time::Instant::now();
-
-        // A good buffer size for reading.
-        //
-        // This is an educated guess about a good buffer size based on
-        // the input and output block sizes.
-        let bsize = calc_bsize(i.settings.ibs, self.settings.obs);
-
-        // Start a thread that reports transfer progress.
-        //
-        // The `dd` program reports its progress after every block is written,
-        // at most every 1 second, and only if `status=progress` is given on
-        // the command-line or a SIGUSR1 signal is received. We
-        // perform this reporting in a new thread so as not to take
-        // any CPU time away from the actual reading and writing of
-        // data. We send a `ProgUpdate` from the transmitter `prog_tx`
-        // to the receives `rx`, and the receiver prints the transfer
-        // information.
-        let (prog_tx, rx) = mpsc::channel();
-        let output_thread = thread::spawn(gen_prog_updater(rx, i.settings.status));
-        let mut progress_as_secs = 0;
-
-        // Optimization: if no blocks are to be written, then don't
-        // bother allocating any buffers.
-        if let Some(Num::Blocks(0) | Num::Bytes(0)) = i.settings.count {
-            return self.finalize(rstat, wstat, start, &prog_tx, output_thread);
-        };
-
-        // Create a common buffer with a capacity of the block size.
-        // This is the max size needed.
-        let mut buf = vec![BUF_INIT_BYTE; bsize];
-
-        // The main read/write loop.
-        //
-        // Each iteration reads blocks from the input and writes
-        // blocks to this output. Read/write statistics are updated on
-        // each iteration and cumulative statistics are reported to
-        // the progress reporting thread.
-        while below_count_limit(&i.settings.count, &rstat, &wstat) {
-            // Read a block from the input then write the block to the output.
-            //
-            // As an optimization, make an educated guess about the
-            // best buffer size for reading based on the number of
-            // blocks already read and the number of blocks remaining.
-            let loop_bsize =
-                calc_loop_bsize(&i.settings.count, &rstat, &wstat, i.settings.ibs, bsize);
-            let rstat_update = read_helper(&mut i, &mut buf, loop_bsize)?;
-            if rstat_update.is_empty() {
-                break;
-            }
-            let wstat_update = self.write_blocks(&buf)?;
-
-            // Update the read/write stats and inform the progress thread once per second.
-            //
-            // If the receiver is disconnected, `send()` returns an
-            // error. Since it is just reporting progress and is not
-            // crucial to the operation of `dd`, let's just ignore the
-            // error.
-            rstat += rstat_update;
-            wstat += wstat_update;
-            let prog_update = ProgUpdate::new(rstat, wstat, start.elapsed(), false);
-            if prog_update.duration.as_secs() >= progress_as_secs {
-                progress_as_secs = prog_update.duration.as_secs() + 1;
-                prog_tx.send(prog_update).unwrap_or(());
-            }
+        // As an optimization, make an educated guess about the
+        // best buffer size for reading based on the number of
+        // blocks already read and the number of blocks remaining.
+        let loop_bsize = calc_loop_bsize(&i.settings.count, &rstat, &wstat, i.settings.ibs, bsize);
+        let rstat_update = read_helper(&mut i, &mut buf, loop_bsize)?;
+        if rstat_update.is_empty() {
+            break;
         }
-        self.finalize(rstat, wstat, start, &prog_tx, output_thread)
+        let wstat_update = o.write_blocks(&buf)?;
+
+        // Update the read/write stats and inform the progress thread once per second.
+        //
+        // If the receiver is disconnected, `send()` returns an
+        // error. Since it is just reporting progress and is not
+        // crucial to the operation of `dd`, let's just ignore the
+        // error.
+        rstat += rstat_update;
+        wstat += wstat_update;
+        let prog_update = ProgUpdate::new(rstat, wstat, start.elapsed(), false);
+        if prog_update.duration.as_secs() >= progress_as_secs {
+            progress_as_secs = prog_update.duration.as_secs() + 1;
+            prog_tx.send(prog_update).unwrap_or(());
+        }
+    }
+    finalize(&mut o, rstat, wstat, start, &prog_tx, output_thread)
+}
+
+/// Flush output, print final stats, and join with the progress thread.
+fn finalize<T>(
+    output: &mut Output,
+    rstat: ReadStat,
+    wstat: WriteStat,
+    start: time::Instant,
+    prog_tx: &mpsc::Sender<ProgUpdate>,
+    output_thread: thread::JoinHandle<T>,
+) -> std::io::Result<()> {
+    // Flush the output, if configured to do so.
+    output.sync()?;
+
+    // Truncate the file to the final cursor location.
+    //
+    // Calling `set_len()` may result in an error (for example,
+    // when calling it on `/dev/null`), but we don't want to
+    // terminate the process when that happens. Instead, we
+    // suppress the error by calling `Result::ok()`. This matches
+    // the behavior of GNU `dd` when given the command-line
+    // argument `of=/dev/null`.
+    if !output.settings.oconv.notrunc {
+        output.dst.truncate().ok();
     }
 
-    /// Flush output, print final stats, and join with the progress thread.
-    fn finalize<T>(
-        &mut self,
-        rstat: ReadStat,
-        wstat: WriteStat,
-        start: time::Instant,
-        prog_tx: &mpsc::Sender<ProgUpdate>,
-        output_thread: thread::JoinHandle<T>,
-    ) -> std::io::Result<()> {
-        // Flush the output, if configured to do so.
-        self.sync()?;
-
-        // Truncate the file to the final cursor location.
-        //
-        // Calling `set_len()` may result in an error (for example,
-        // when calling it on `/dev/null`), but we don't want to
-        // terminate the process when that happens. Instead, we
-        // suppress the error by calling `Result::ok()`. This matches
-        // the behavior of GNU `dd` when given the command-line
-        // argument `of=/dev/null`.
-        if !self.settings.oconv.notrunc {
-            self.dst.truncate().ok();
-        }
-
-        // Print the final read/write statistics.
-        let prog_update = ProgUpdate::new(rstat, wstat, start.elapsed(), true);
-        prog_tx.send(prog_update).unwrap_or(());
-        // Wait for the output thread to finish
-        output_thread
-            .join()
-            .expect("Failed to join with the output thread.");
-        Ok(())
-    }
+    // Print the final read/write statistics.
+    let prog_update = ProgUpdate::new(rstat, wstat, start.elapsed(), true);
+    prog_tx.send(prog_update).unwrap_or(());
+    // Wait for the output thread to finish
+    output_thread
+        .join()
+        .expect("Failed to join with the output thread.");
+    Ok(())
 }
 
 #[cfg(any(target_os = "linux", target_os = "android"))]
@@ -1950,7 +1948,7 @@
         }
         None => Output::new_stdout(&settings)?,
     };
-    o.dd_out(i).map_err_context(|| "IO error".to_string())
+    dd_copy(i, o).map_err_context(|| "IO error".to_string())
 }
 
 pub fn uu_app() -> Command {
diff --git a/dev/src/uu_fmt/fmt.rs.html b/dev/src/uu_fmt/fmt.rs.html
index 45a1005ec..0d1d4e2db 100644
--- a/dev/src/uu_fmt/fmt.rs.html
+++ b/dev/src/uu_fmt/fmt.rs.html
@@ -373,7 +373,7 @@
 use std::io::{BufReader, BufWriter, Read};
 use uucore::display::Quotable;
 use uucore::error::{FromIo, UResult, USimpleError};
-use uucore::{format_usage, show_warning};
+use uucore::{format_usage, help_about, help_usage, show_warning};
 
 use self::linebreak::break_lines;
 use self::parasplit::ParagraphStream;
@@ -381,8 +381,8 @@
 mod linebreak;
 mod parasplit;
 
-static ABOUT: &str = "Reformat paragraphs from input files (or stdin) to stdout.";
-const USAGE: &str = "{} [OPTION]... [FILE]...";
+static ABOUT: &str = help_about!("fmt.md");
+const USAGE: &str = help_usage!("fmt.md");
 static MAX_WIDTH: usize = 2500;
 
 static OPT_CROWN_MARGIN: &str = "crown-margin";
diff --git a/dev/src/uu_realpath/realpath.rs.html b/dev/src/uu_realpath/realpath.rs.html
index 604b06eb8..0e876e9d8 100644
--- a/dev/src/uu_realpath/realpath.rs.html
+++ b/dev/src/uu_realpath/realpath.rs.html
@@ -292,6 +292,7 @@
 292
 293
 294
+295
 
//  * This file is part of the uutils coreutils package.
 //  *
 //  * (c) 2014 Vsevolod Velichko <torkvemada@sorokdva.net>
@@ -314,11 +315,12 @@
     error::{FromIo, UResult},
     format_usage,
     fs::{canonicalize, MissingHandling, ResolveMode},
+    help_about, help_usage,
 };
 use uucore::{error::UClapError, show, show_if_err};
 
-static ABOUT: &str = "Print the resolved path";
-const USAGE: &str = "{} [OPTION]... FILE...";
+static ABOUT: &str = help_about!("realpath.md");
+const USAGE: &str = help_usage!("realpath.md");
 
 static OPT_QUIET: &str = "quiet";
 static OPT_STRIP: &str = "strip";
diff --git a/dev/uu_chgrp/entries/struct.Passwd.html b/dev/uu_chgrp/entries/struct.Passwd.html
index 41268fdbc..d077cad64 100644
--- a/dev/uu_chgrp/entries/struct.Passwd.html
+++ b/dev/uu_chgrp/entries/struct.Passwd.html
@@ -27,7 +27,7 @@ call getgrouplist().

not update ngroups if ngroups is too small. Therefore, if not updated by getgrouplist, ngroups needs to be increased in a loop until getgrouplist stops returning -1.

-

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

diff --git a/dev/uu_chown/entries/struct.Passwd.html b/dev/uu_chown/entries/struct.Passwd.html index 85861505c..9fc7918fa 100644 --- a/dev/uu_chown/entries/struct.Passwd.html +++ b/dev/uu_chown/entries/struct.Passwd.html @@ -27,7 +27,7 @@ call getgrouplist().

not update ngroups if ngroups is too small. Therefore, if not updated by getgrouplist, ngroups needs to be increased in a loop until getgrouplist stops returning -1.

-

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

diff --git a/dev/uu_chown/struct.Passwd.html b/dev/uu_chown/struct.Passwd.html index 8557759c1..8fac5e7a4 100644 --- a/dev/uu_chown/struct.Passwd.html +++ b/dev/uu_chown/struct.Passwd.html @@ -27,7 +27,7 @@ call getgrouplist().

not update ngroups if ngroups is too small. Therefore, if not updated by getgrouplist, ngroups needs to be increased in a loop until getgrouplist stops returning -1.

-

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

diff --git a/dev/uu_dd/fn.uu_app.html b/dev/uu_dd/fn.uu_app.html index 77cb7cd66..dd77d0526 100644 --- a/dev/uu_dd/fn.uu_app.html +++ b/dev/uu_dd/fn.uu_app.html @@ -1 +1 @@ -uu_app in uu_dd - Rust

Function uu_dd::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file +uu_app in uu_dd - Rust

Function uu_dd::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/dev/uu_dd/fn.uumain.html b/dev/uu_dd/fn.uumain.html index b9019b4e7..83eff5ea6 100644 --- a/dev/uu_dd/fn.uumain.html +++ b/dev/uu_dd/fn.uumain.html @@ -1 +1 @@ -uumain in uu_dd - Rust

Function uu_dd::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file +uumain in uu_dd - Rust

Function uu_dd::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/dev/uu_dd/index.html b/dev/uu_dd/index.html index f28a748a9..77bedb9c8 100644 --- a/dev/uu_dd/index.html +++ b/dev/uu_dd/index.html @@ -1 +1 @@ -uu_dd - Rust
\ No newline at end of file +uu_dd - Rust
\ No newline at end of file diff --git a/dev/uu_realpath/fn.uu_app.html b/dev/uu_realpath/fn.uu_app.html index 07f281a36..d0b92ba1e 100644 --- a/dev/uu_realpath/fn.uu_app.html +++ b/dev/uu_realpath/fn.uu_app.html @@ -1 +1 @@ -uu_app in uu_realpath - Rust

Function uu_realpath::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file +uu_app in uu_realpath - Rust

Function uu_realpath::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/dev/uu_realpath/fn.uumain.html b/dev/uu_realpath/fn.uumain.html index 295e3624a..5447834a5 100644 --- a/dev/uu_realpath/fn.uumain.html +++ b/dev/uu_realpath/fn.uumain.html @@ -1 +1 @@ -uumain in uu_realpath - Rust

Function uu_realpath::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file +uumain in uu_realpath - Rust

Function uu_realpath::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/dev/uu_realpath/index.html b/dev/uu_realpath/index.html index 9d498ef4f..025002b5f 100644 --- a/dev/uu_realpath/index.html +++ b/dev/uu_realpath/index.html @@ -1 +1 @@ -uu_realpath - Rust
\ No newline at end of file +uu_realpath - Rust
\ No newline at end of file