Discussing FileSystem >> #workingDirectory and VM process getcwd(3)
Hi guys, In a couple of recent threads, there were discussions about FileSystem >> #workingDirectory VS VM process getcwd(3) and the fact that they do not match. The current state is as follows: 1) *If Pharo was launched from double click* then we do not care about its location and I think it's correct to default to image location: 1.1) FileSystem >> #workingDirectory refers to the directory containing the .image file 1.2) The VM process getcmd() is the default one of the particular OS ($HOME in my OSX). So...there is a mismatch between #workingDirectory and VM's process cmd. *I think (as Damien said), that we should do a chdir() for the VM process to match the .image location. * 2) *If Pharo was launched from command line* then we likely are interested in the current CMD from where we launched the VM process (imagine using Pharo for scripting). The current status is: 2.1) FileSystem >> #workingDirectory still refers to the directory containing the .image file which I think it is incorrect. 2.2) The CMD of the VM process is correct. But again, there is a mismatch with #workingDirectory. *For this case, I think we should set FileSystem >> #workingDirectory to CMD. * Before start discussing how to implement this, do you agree with the idea? Thanks in advance, -- Mariano http://marianopeck.wordpress.com
this pinged my memory about OSX ... the funkiness is that you had to arrange for PWD to be set "correctly" when double clicking an application ... when running from the command line PWD was set "correctly" ... This was affecting GemStone because I was using the PWD of the client in certain circumstances (and years ago) ... Sounds like this quirk probably doesn't apply, but I still think it is something to be aware of ... Dale On 3/21/16 11:13 AM, Mariano Martinez Peck wrote:
Hi guys,
In a couple of recent threads, there were discussions about FileSystem >> #workingDirectory VS VM process getcwd(3) and the fact that they do not match.
The current state is as follows:
1) *If Pharo was launched from double click* then we do not care about its location and I think it's correct to default to image location:
1.1) FileSystem >> #workingDirectory refers to the directory containing the .image file 1.2) The VM process getcmd() is the default one of the particular OS ($HOME in my OSX).
So...there is a mismatch between #workingDirectory and VM's process cmd.
*I think (as Damien said), that we should do a chdir() for the VM process to match the .image location. *
2) *If Pharo was launched from command line* then we likely are interested in the current CMD from where we launched the VM process (imagine using Pharo for scripting). The current status is:
2.1) FileSystem >> #workingDirectory still refers to the directory containing the .image file which I think it is incorrect. 2.2) The CMD of the VM process is correct. But again, there is a mismatch with #workingDirectory.
*For this case, I think we should set FileSystem >> #workingDirectory to CMD. *
Before start discussing how to implement this, do you agree with the idea?
Thanks in advance,
-- Mariano http://marianopeck.wordpress.com
+1 FileSystem workingDirectory should never ever diverge from getcwd(); 2.1 is definitely a bug. On 21 March 2016 at 19:39, Dale Henrichs <dale.henrichs@gemtalksystems.com> wrote:
this pinged my memory about OSX ... the funkiness is that you had to arrange for PWD to be set "correctly" when double clicking an application ... when running from the command line PWD was set "correctly" ...
This was affecting GemStone because I was using the PWD of the client in certain circumstances (and years ago) ...
Sounds like this quirk probably doesn't apply, but I still think it is something to be aware of ...
Dale
On 3/21/16 11:13 AM, Mariano Martinez Peck wrote:
Hi guys,
In a couple of recent threads, there were discussions about FileSystem >> #workingDirectory VS VM process getcwd(3) and the fact that they do not match.
The current state is as follows:
1) *If Pharo was launched from double click* then we do not care about its location and I think it's correct to default to image location:
1.1) FileSystem >> #workingDirectory refers to the directory containing the .image file 1.2) The VM process getcmd() is the default one of the particular OS ($HOME in my OSX).
So...there is a mismatch between #workingDirectory and VM's process cmd.
*I think (as Damien said), that we should do a chdir() for the VM process to match the .image location. *
2) *If Pharo was launched from command line* then we likely are interested in the current CMD from where we launched the VM process (imagine using Pharo for scripting). The current status is:
2.1) FileSystem >> #workingDirectory still refers to the directory containing the .image file which I think it is incorrect. 2.2) The CMD of the VM process is correct. But again, there is a mismatch with #workingDirectory.
*For this case, I think we should set FileSystem >> #workingDirectory to CMD. *
Before start discussing how to implement this, do you agree with the idea?
Thanks in advance,
-- Mariano http://marianopeck.wordpress.com
-- Damien Pollet type less, do more [ | ] http://people.untyped.org/damien.pollet
Mariano Martinez Peck <marianopeck@gmail.com> writes:
1) *If Pharo was launched from double click* then we do not care about its location and I think it's correct to default to image location:
1.1) FileSystem >> #workingDirectory refers to the directory containing the .image file 1.2) The VM process getcmd() is the default one of the particular OS ($HOME in my OSX).
So...there is a mismatch between #workingDirectory and VM's process cmd.
*I think (as Damien said), that we should do a chdir() for the VM process to match the .image location. *
typical applications ran with double-click are bound to the HOME directory. Why do you want to do it differently? -- Damien Cassou http://damiencassou.seasidehosting.st "Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill
On 22 March 2016 at 12:56, Damien Cassou <damien.cassou@inria.fr> wrote:
typical applications ran with double-click are bound to the HOME directory. Why do you want to do it differently?
Only on Linux. On OS X it's / -- Damien Pollet type less, do more [ | ] http://people.untyped.org/damien.pollet
Damien Pollet <damien.pollet@gmail.com> writes:
On 22 March 2016 at 12:56, Damien Cassou <damien.cassou@inria.fr> wrote:
typical applications ran with double-click are bound to the HOME directory. Why do you want to do it differently?
Only on Linux. On OS X it's /
so, why do you want to make it the image directory? -- Damien Cassou http://damiencassou.seasidehosting.st "Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill
Because there is this concept called "consistency" that's interesting to have :p If your code wants $HOME it can ask for it explicitly, same for /. However if it just wants to do something in $PWD consistent with most use-cases, the image directory is the sensible default. On 22 March 2016 at 13:05, Damien Cassou <damien.cassou@inria.fr> wrote:
Damien Pollet <damien.pollet@gmail.com> writes:
On 22 March 2016 at 12:56, Damien Cassou <damien.cassou@inria.fr> wrote:
typical applications ran with double-click are bound to the HOME directory. Why do you want to do it differently?
Only on Linux. On OS X it's /
so, why do you want to make it the image directory?
-- Damien Cassou http://damiencassou.seasidehosting.st
"Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill
-- Damien Pollet type less, do more [ | ] http://people.untyped.org/damien.pollet
On Tue, Mar 22, 2016 at 9:37 AM, Damien Pollet <damien.pollet@gmail.com> wrote:
Because there is this concept called "consistency" that's interesting to have :p
If your code wants $HOME it can ask for it explicitly, same for /. However if it just wants to do something in $PWD consistent with most use-cases, the image directory is the sensible default.
I agree with Pollet. I don't care if it is image directory or $HOME. What I care is that $PWD of the VM process should match with FileSystem >> workingDirectory. And right now it does not match.
On 22 March 2016 at 13:05, Damien Cassou <damien.cassou@inria.fr> wrote:
Damien Pollet <damien.pollet@gmail.com> writes:
On 22 March 2016 at 12:56, Damien Cassou <damien.cassou@inria.fr> wrote:
typical applications ran with double-click are bound to the HOME directory. Why do you want to do it differently?
Only on Linux. On OS X it's /
so, why do you want to make it the image directory?
-- Damien Cassou http://damiencassou.seasidehosting.st
"Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill
-- Damien Pollet type less, do more [ | ] http://people.untyped.org/damien.pollet
-- Mariano http://marianopeck.wordpress.com
Mariano, I think this _is_ the OSX issue that I was talking about ... there is a way to arrange for PWD to be set correctly when double clicking apps, but it has to be set a system option so each user has to do it themselves ... Dale On 3/22/16 6:01 AM, Mariano Martinez Peck wrote:
On Tue, Mar 22, 2016 at 9:37 AM, Damien Pollet <damien.pollet@gmail.com <mailto:damien.pollet@gmail.com>> wrote:
Because there is this concept called "consistency" that's interesting to have :p
If your code wants $HOME it can ask for it explicitly, same for /. However if it just wants to do something in $PWD consistent with most use-cases, the image directory is the sensible default.
I agree with Pollet. I don't care if it is image directory or $HOME. What I care is that $PWD of the VM process should match with FileSystem >> workingDirectory. And right now it does not match.
On 22 March 2016 at 13:05, Damien Cassou <damien.cassou@inria.fr <mailto:damien.cassou@inria.fr>> wrote:
Damien Pollet <damien.pollet@gmail.com <mailto:damien.pollet@gmail.com>> writes:
> On 22 March 2016 at 12:56, Damien Cassou <damien.cassou@inria.fr <mailto:damien.cassou@inria.fr>> wrote: > >> typical applications ran with double-click are bound to the HOME >> directory. Why do you want to do it differently? >> > > Only on Linux. On OS X it's /
so, why do you want to make it the image directory?
-- Damien Cassou http://damiencassou.seasidehosting.st
"Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill
-- Damien Pollet type less, do more [ | ] http://people.untyped.org/damien.pollet
-- Mariano http://marianopeck.wordpress.com
Hi Dale, On Tue, Mar 22, 2016 at 7:49 AM, Dale Henrichs < dale.henrichs@gemtalksystems.com> wrote:
Mariano,
I think this _is_ the OSX issue that I was talking about ... there is a way to arrange for PWD to be set correctly when double clicking apps, but it has to be set a system option so each user has to do it themselves ...
Is that a setting in the Desktop preferences (or...?) or is it a setting on the app itself?
Dale
On 3/22/16 6:01 AM, Mariano Martinez Peck wrote:
On Tue, Mar 22, 2016 at 9:37 AM, Damien Pollet <damien.pollet@gmail.com> wrote:
Because there is this concept called "consistency" that's interesting to have :p
If your code wants $HOME it can ask for it explicitly, same for /. However if it just wants to do something in $PWD consistent with most use-cases, the image directory is the sensible default.
I agree with Pollet. I don't care if it is image directory or $HOME. What I care is that $PWD of the VM process should match with FileSystem >> workingDirectory. And right now it does not match.
On 22 March 2016 at 13:05, Damien Cassou < <damien.cassou@inria.fr> damien.cassou@inria.fr> wrote:
Damien Pollet < <damien.pollet@gmail.com>damien.pollet@gmail.com> writes:
On 22 March 2016 at 12:56, Damien Cassou <damien.cassou@inria.fr> wrote:
typical applications ran with double-click are bound to the HOME directory. Why do you want to do it differently?
Only on Linux. On OS X it's /
so, why do you want to make it the image directory?
-- Damien Cassou http://damiencassou.seasidehosting.st
"Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill
-- Damien Pollet type less, do more [ | ] http://people.untyped.org/damien.pollet
-- Mariano http://marianopeck.wordpress.com
-- _,,,^..^,,,_ best, Eliot
I think it was a shell command and`sudo` may have been required ... I had to do it with Mavericks (or earlier) ... it's possible that with Yosemite that it is no longer possible:) I haven't checked for a while. Dale On 3/23/16 5:46 PM, Eliot Miranda wrote:
Hi Dale,
On Tue, Mar 22, 2016 at 7:49 AM, Dale Henrichs <dale.henrichs@gemtalksystems.com <mailto:dale.henrichs@gemtalksystems.com>> wrote:
Mariano,
I think this _is_ the OSX issue that I was talking about ... there is a way to arrange for PWD to be set correctly when double clicking apps, but it has to be set a system option so each user has to do it themselves ...
Is that a setting in the Desktop preferences (or...?) or is it a setting on the app itself?
Dale
On 3/22/16 6:01 AM, Mariano Martinez Peck wrote:
On Tue, Mar 22, 2016 at 9:37 AM, Damien Pollet <damien.pollet@gmail.com <mailto:damien.pollet@gmail.com>> wrote:
Because there is this concept called "consistency" that's interesting to have :p
If your code wants $HOME it can ask for it explicitly, same for /. However if it just wants to do something in $PWD consistent with most use-cases, the image directory is the sensible default.
I agree with Pollet. I don't care if it is image directory or $HOME. What I care is that $PWD of the VM process should match with FileSystem >> workingDirectory. And right now it does not match.
On 22 March 2016 at 13:05, Damien Cassou <damien.cassou@inria.fr <mailto:damien.cassou@inria.fr>> wrote:
Damien Pollet <damien.pollet@gmail.com <mailto:damien.pollet@gmail.com>> writes:
> On 22 March 2016 at 12:56, Damien Cassou <damien.cassou@inria.fr <mailto:damien.cassou@inria.fr>> wrote: > >> typical applications ran with double-click are bound to the HOME >> directory. Why do you want to do it differently? >> > > Only on Linux. On OS X it's /
so, why do you want to make it the image directory?
-- Damien Cassou http://damiencassou.seasidehosting.st
"Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill
-- Damien Pollet type less, do more [ | ] http://people.untyped.org/damien.pollet
-- Mariano http://marianopeck.wordpress.com
-- _,,,^..^,,,_ best, Eliot
Mariano Martinez Peck <marianopeck@gmail.com> writes:
On Tue, Mar 22, 2016 at 9:37 AM, Damien Pollet <damien.pollet@gmail.com> wrote:
Because there is this concept called "consistency" that's interesting to have :p
If your code wants $HOME it can ask for it explicitly, same for /. However if it just wants to do something in $PWD consistent with most use-cases, the image directory is the sensible default.
I agree with Pollet. I don't care if it is image directory or $HOME. What I care is that $PWD of the VM process should match with FileSystem >> workingDirectory. And right now it does not match.
I was not clear enough: I agree that consistency is important and VM must answer the same as image. What that "same" should be is still unclear to me though. You propose the image folder, but this is inconsistent with other applications launched by double-click. I propose to be consistent with other applications: HOME on Linux, / on OS X. -- Damien Cassou http://damiencassou.seasidehosting.st "Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill
as long as $PWD is respected, I don't think either way really matters On 23 March 2016 at 11:53, Damien Cassou <damien.cassou@inria.fr> wrote:
Mariano Martinez Peck <marianopeck@gmail.com> writes:
On Tue, Mar 22, 2016 at 9:37 AM, Damien Pollet <damien.pollet@gmail.com> wrote:
Because there is this concept called "consistency" that's interesting to have :p
If your code wants $HOME it can ask for it explicitly, same for /. However if it just wants to do something in $PWD consistent with most use-cases, the image directory is the sensible default.
I agree with Pollet. I don't care if it is image directory or $HOME. What I care is that $PWD of the VM process should match with FileSystem >> workingDirectory. And right now it does not match.
I was not clear enough: I agree that consistency is important and VM must answer the same as image. What that "same" should be is still unclear to me though. You propose the image folder, but this is inconsistent with other applications launched by double-click. I propose to be consistent with other applications: HOME on Linux, / on OS X.
-- Damien Cassou http://damiencassou.seasidehosting.st
"Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill
-- Damien Pollet type less, do more [ | ] http://people.untyped.org/damien.pollet
participants (5)
-
Dale Henrichs -
Damien Cassou -
Damien Pollet -
Eliot Miranda -
Mariano Martinez Peck