@@ -9,6 +9,7 @@ use clap::builder::ValueParser;
99use clap:: parser:: ValuesRef ;
1010use clap:: { Arg , ArgAction , ArgMatches , Command } ;
1111use std:: ffi:: OsString ;
12+ use std:: io:: { Write , stdout} ;
1213use std:: path:: { Path , PathBuf } ;
1314#[ cfg( all( unix, target_os = "linux" ) ) ]
1415use uucore:: error:: FromIo ;
@@ -308,10 +309,11 @@ fn create_single_dir(path: &Path, is_parent: bool, config: &Config) -> UResult<(
308309 match create_dir_with_mode ( path, create_mode) {
309310 Ok ( ( ) ) => {
310311 if config. verbose {
311- println ! (
312+ writeln ! (
313+ stdout( ) ,
312314 "{}" ,
313315 translate!( "mkdir-verbose-created-directory" , "util_name" => uucore:: util_name( ) , "path" => path. quote( ) )
314- ) ;
316+ ) ? ;
315317 }
316318
317319 // On Linux, we may need to add ACL permission bits via chmod.
@@ -357,10 +359,11 @@ fn create_single_dir(path: &Path, is_parent: bool, config: &Config) -> UResult<(
357359 // Print verbose message for logical directories, even if they exist
358360 // This matches GNU behavior for paths like "test_dir/../test_dir_a"
359361 if config. verbose && is_parent && config. recursive && !ends_with_parent_dir {
360- println ! (
362+ writeln ! (
363+ stdout( ) ,
361364 "{}" ,
362365 translate!( "mkdir-verbose-created-directory" , "util_name" => uucore:: util_name( ) , "path" => path. quote( ) )
363- ) ;
366+ ) ? ;
364367 }
365368 Ok ( ( ) )
366369 }
0 commit comments