yamt commented on PR #8868:
URL: https://github.com/apache/nuttx/pull/8868#issuecomment-1479289100

   > > > In the sim, hostfs uses $CWD as the root path. When running in 
different paths, the access path of hostfs is different.
   > > 
   > > 
   > > what's wrong with it?
   > 
   > @yamt Here is an example, Directory layout:
   > 
   > ```
   > work/apps/
   > work/nuttx/
   > work/data/
   > ```
   > 
   > rcS contain:
   > 
   > ```
   > mount -t hostfs ../data /data
   > ```
   > 
   > if user launch nuttx by:
   > 
   > ```
   > cd work/nuttx
   > ./nuttx
   > ```
   > 
   > he can access PC's data directory without error, but if user launch nuttx 
by:
   > 
   > ```
   > cd work
   > ./nuttx/nuttx
   > ```
   > 
   > ls /data will report the error. This patch ensures the user get the 
consistent result regardless he launches the program from anywhere.
   
   probably sometimes it's a good thing.
   in the other cases it can be a bad thing.
   i don't see much motivation to change the behavior.
   
   > 
   > > > This patch is changed to use the path where the nuttx file is located 
as the root path, so that the mounted path is fixed when executed in different 
paths
   > > 
   > > 
   > > i feel it's awkward to use the path of the executable for this purpose.
   > 
   > Do you have better suggestion?
   
   if you want a consistent result, why don't you use a consistent cwd?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to