File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -626,6 +626,14 @@ impl Command {
626
626
627
627
/// Sets the working directory for the child process.
628
628
///
629
+ /// # Platform-specific behavior
630
+ ///
631
+ /// If the program path is relative (e.g. `"./script.sh"`), it's ambiguous
632
+ /// whether it should be interpreted relative to the parent's working
633
+ /// directory or relative to `current_dir`. The behavior in this case is
634
+ /// platform specific and unstable, and it's recommended to use
635
+ /// [`canonicalize`] to get an absolute program path instead.
636
+ ///
629
637
/// # Examples
630
638
///
631
639
/// Basic usage:
@@ -638,6 +646,8 @@ impl Command {
638
646
/// .spawn()
639
647
/// .expect("ls command failed to start");
640
648
/// ```
649
+ ///
650
+ /// [`canonicalize`]: ../fs/fn.canonicalize.html
641
651
#[ stable( feature = "process" , since = "1.0.0" ) ]
642
652
pub fn current_dir < P : AsRef < Path > > ( & mut self , dir : P ) -> & mut Command {
643
653
self . inner . cwd ( dir. as_ref ( ) . as_ref ( ) ) ;
You can’t perform that action at this time.
0 commit comments