File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -626,6 +626,14 @@ impl Command {
626626
627627 /// Sets the working directory for the child process.
628628 ///
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+ ///
629637 /// # Examples
630638 ///
631639 /// Basic usage:
@@ -638,6 +646,8 @@ impl Command {
638646 /// .spawn()
639647 /// .expect("ls command failed to start");
640648 /// ```
649+ ///
650+ /// [`canonicalize`]: ../fs/fn.canonicalize.html
641651 #[ stable( feature = "process" , since = "1.0.0" ) ]
642652 pub fn current_dir < P : AsRef < Path > > ( & mut self , dir : P ) -> & mut Command {
643653 self . inner . cwd ( dir. as_ref ( ) . as_ref ( ) ) ;
You can’t perform that action at this time.
0 commit comments