[Pharo-project] Dumb question: ~ vs. /home/user
For the unix gurus among us, what should happen in response to ( FileDirectory on:'~/ExistingDirectory' ) entries? It creates a path name of /~ExistingDirectory and then fumbles trying to read it. Is this something that should be expected to work, or is ~ just a trick of the shell? Bill
"Wilhelm" == Schwab,Wilhelm K <bschwab@anest.ufl.edu> writes:
Wilhelm> It creates a path name of /~ExistingDirectory and then fumbles trying Wilhelm> to read it. Is this something that should be expected to work, or is Wilhelm> ~ just a trick of the shell? Yes, ~ has always been a userspace feature. Never a kernel feature. If you get all the way to mkdir(2) or open(2) with a ~, it literally means a tilde char in a pathname. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
Schwab,Wilhelm K wrote:
For the unix gurus among us, what should happen in response to
( FileDirectory on:'~/ExistingDirectory' ) entries?
It creates a path name of /~ExistingDirectory and then fumbles trying to read it. Is this something that should be expected to work, or is ~ just a trick of the shell?
Bill
------------------------------------------------------------------------
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
This is a unix notation for user home directory or folder
Understood - the question was (is?) whether or not Pharo should recognize it and act accordingly - I suspect the answer is no. Bill -----Original Message----- From: pharo-project-bounces@lists.gforge.inria.fr [mailto:pharo-project-bounces@lists.gforge.inria.fr] On Behalf Of intrader Sent: Sunday, October 04, 2009 2:03 PM To: Pharo-project@lists.gforge.inria.fr Subject: Re: [Pharo-project] Dumb question: ~ vs. /home/user Schwab,Wilhelm K wrote:
For the unix gurus among us, what should happen in response to
( FileDirectory on:'~/ExistingDirectory' ) entries?
It creates a path name of /~ExistingDirectory and then fumbles trying to read it. Is this something that should be expected to work, or is ~ just a trick of the shell?
Bill
---------------------------------------------------------------------- --
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
This is a unix notation for user home directory or folder _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
"Wilhelm" == Schwab,Wilhelm K <bschwab@anest.ufl.edu> writes:
Wilhelm> Understood - the question was (is?) whether or not Pharo should Wilhelm> recognize it and act accordingly - I suspect the answer is no. It *should* be understood and interpreted in the same places where '*' and '?' and '[]' are used for globbing, since it's effectively a globbing character. So for example, presuming a hypothetical: '*.st' matchingFiles to return everything matching in the default directory, then: '~/foo' matchingFiles should return something relative to the home directory of the current user. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
Isn't this OS-centric ? Nicolas 2009/10/4 Randal L. Schwartz <merlyn@stonehenge.com>:
"Wilhelm" == Schwab,Wilhelm K <bschwab@anest.ufl.edu> writes:
Wilhelm> Understood - the question was (is?) whether or not Pharo should Wilhelm> recognize it and act accordingly - I suspect the answer is no.
It *should* be understood and interpreted in the same places where '*' and '?' and '[]' are used for globbing, since it's effectively a globbing character.
So for example, presuming a hypothetical:
 '*.st' matchingFiles
to return everything matching in the default directory, then:
 '~/foo' matchingFiles
should return something relative to the home directory of the current user.
-- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Nicolas, It is OS-specific, but there is no reason to avoid doing things that are expected on the local host - mac menus come to mind. An OS-neutral approach gets the least-common denominator. Another more fundamental example: the windows guys should get ready to part with drive letters :) I think Randall nailed it with wildcards; that's where it fits. I suppose one could provide a Windows version of it (/home/user could map to the documents and settings craziness), though I learned the hard way to steer clear of such things on Windows - if I have to use Windows, give me my own directory on c: any day. This cropped up in porting one of my tools that I've used for longer than I care to describe, and have ported a couple of times. Now I need a Linux version of it, and ~ would be a nice solution to some problems that quickly surfaced. Bill -----Original Message----- From: pharo-project-bounces@lists.gforge.inria.fr [mailto:pharo-project-bounces@lists.gforge.inria.fr] On Behalf Of Nicolas Cellier Sent: Sunday, October 04, 2009 3:28 PM To: Pharo-project@lists.gforge.inria.fr Subject: Re: [Pharo-project] Dumb question: ~ vs. /home/user Isn't this OS-centric ? Nicolas 2009/10/4 Randal L. Schwartz <merlyn@stonehenge.com>:
"Wilhelm" == Schwab,Wilhelm K <bschwab@anest.ufl.edu> writes:
Wilhelm> Understood - the question was (is?) whether or not Pharo Wilhelm> should recognize it and act accordingly - I suspect the answer is no.
It *should* be understood and interpreted in the same places where '*' and '?' and '[]' are used for globbing, since it's effectively a globbing character.
So for example, presuming a hypothetical:
 '*.st' matchingFiles
to return everything matching in the default directory, then:
 '~/foo' matchingFiles
should return something relative to the home directory of the current user.
-- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
If you follow that path, don't forget we might require a way to escape '\~' Nicolas 2009/10/4 Schwab,Wilhelm K <bschwab@anest.ufl.edu>:
Nicolas,
It is OS-specific, but there is no reason to avoid doing things that are expected on the local host - mac menus come to mind. Â An OS-neutral approach gets the least-common denominator. Â Another more fundamental example: the windows guys should get ready to part with drive letters :)
I think Randall nailed it with wildcards; that's where it fits. Â I suppose one could provide a Windows version of it (/home/user could map to the documents and settings craziness), though I learned the hard way to steer clear of such things on Windows - if I have to use Windows, give me my own directory on c: any day.
This cropped up in porting one of my tools that I've used for longer than I care to describe, and have ported a couple of times. Â Now I need a Linux version of it, and ~ would be a nice solution to some problems that quickly surfaced.
Bill
-----Original Message----- From: pharo-project-bounces@lists.gforge.inria.fr [mailto:pharo-project-bounces@lists.gforge.inria.fr] On Behalf Of Nicolas Cellier Sent: Sunday, October 04, 2009 3:28 PM To: Pharo-project@lists.gforge.inria.fr Subject: Re: [Pharo-project] Dumb question: ~ vs. /home/user
Isn't this OS-centric ?
Nicolas
2009/10/4 Randal L. Schwartz <merlyn@stonehenge.com>:
"Wilhelm" == Schwab,Wilhelm K <bschwab@anest.ufl.edu> writes:
Wilhelm> Understood - the question was (is?) whether or not Pharo Wilhelm> should recognize it and act accordingly - I suspect the answer is no.
It *should* be understood and interpreted in the same places where '*' and '?' and '[]' are used for globbing, since it's effectively a globbing character.
So for example, presuming a hypothetical:
 '*.st' matchingFiles
to return everything matching in the default directory, then:
 '~/foo' matchingFiles
should return something relative to the home directory of the current user.
-- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Nicolas, The ~ I have in mind appears only as the first character since it replaces /home/userName, so it might not be a problem. Am I missing something? I realize I mentioned /~/andSoOn, but that was only in the context of Pharo's having introduced the leading /, turning ~/andSoOn into garbage and then getting confused by it, or something like that. Bill -----Original Message----- From: pharo-project-bounces@lists.gforge.inria.fr [mailto:pharo-project-bounces@lists.gforge.inria.fr] On Behalf Of Nicolas Cellier Sent: Sunday, October 04, 2009 4:05 PM To: Pharo-project@lists.gforge.inria.fr Subject: Re: [Pharo-project] Dumb question: ~ vs. /home/user If you follow that path, don't forget we might require a way to escape '\~' Nicolas 2009/10/4 Schwab,Wilhelm K <bschwab@anest.ufl.edu>:
Nicolas,
It is OS-specific, but there is no reason to avoid doing things that are expected on the local host - mac menus come to mind. Â An OS-neutral approach gets the least-common denominator. Â Another more fundamental example: the windows guys should get ready to part with drive letters :)
I think Randall nailed it with wildcards; that's where it fits. Â I suppose one could provide a Windows version of it (/home/user could map to the documents and settings craziness), though I learned the hard way to steer clear of such things on Windows - if I have to use Windows, give me my own directory on c: any day.
This cropped up in porting one of my tools that I've used for longer than I care to describe, and have ported a couple of times. Â Now I need a Linux version of it, and ~ would be a nice solution to some problems that quickly surfaced.
Bill
-----Original Message----- From: pharo-project-bounces@lists.gforge.inria.fr [mailto:pharo-project-bounces@lists.gforge.inria.fr] On Behalf Of Nicolas Cellier Sent: Sunday, October 04, 2009 3:28 PM To: Pharo-project@lists.gforge.inria.fr Subject: Re: [Pharo-project] Dumb question: ~ vs. /home/user
Isn't this OS-centric ?
Nicolas
2009/10/4 Randal L. Schwartz <merlyn@stonehenge.com>:
"Wilhelm" == Schwab,Wilhelm K <bschwab@anest.ufl.edu> writes:
Wilhelm> Understood - the question was (is?) whether or not Pharo Wilhelm> should recognize it and act accordingly - I suspect the answer is no.
It *should* be understood and interpreted in the same places where '*' and '?' and '[]' are used for globbing, since it's effectively a globbing character.
So for example, presuming a hypothetical:
 '*.st' matchingFiles
to return everything matching in the default directory, then:
 '~/foo' matchingFiles
should return something relative to the home directory of the current user.
-- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
mkdir \~ ls -al \~ How will you access this directory from Squeak ? Nicolas 2009/10/5 Schwab,Wilhelm K <bschwab@anest.ufl.edu>:
Nicolas,
The ~ I have in mind appears only as the first character since it replaces /home/userName, so it might not be a problem. Â Am I missing something?
I realize I mentioned /~/andSoOn, but that was only in the context of Pharo's having introduced the leading /, turning ~/andSoOn into garbage and then getting confused by it, or something like that.
Bill
-----Original Message----- From: pharo-project-bounces@lists.gforge.inria.fr [mailto:pharo-project-bounces@lists.gforge.inria.fr] On Behalf Of Nicolas Cellier Sent: Sunday, October 04, 2009 4:05 PM To: Pharo-project@lists.gforge.inria.fr Subject: Re: [Pharo-project] Dumb question: ~ vs. /home/user
If you follow that path, don't forget we might require a way to escape '\~'
Nicolas
2009/10/4 Schwab,Wilhelm K <bschwab@anest.ufl.edu>:
Nicolas,
It is OS-specific, but there is no reason to avoid doing things that are expected on the local host - mac menus come to mind. Â An OS-neutral approach gets the least-common denominator. Â Another more fundamental example: the windows guys should get ready to part with drive letters :)
I think Randall nailed it with wildcards; that's where it fits. Â I suppose one could provide a Windows version of it (/home/user could map to the documents and settings craziness), though I learned the hard way to steer clear of such things on Windows - if I have to use Windows, give me my own directory on c: any day.
This cropped up in porting one of my tools that I've used for longer than I care to describe, and have ported a couple of times. Â Now I need a Linux version of it, and ~ would be a nice solution to some problems that quickly surfaced.
Bill
-----Original Message----- From: pharo-project-bounces@lists.gforge.inria.fr [mailto:pharo-project-bounces@lists.gforge.inria.fr] On Behalf Of Nicolas Cellier Sent: Sunday, October 04, 2009 3:28 PM To: Pharo-project@lists.gforge.inria.fr Subject: Re: [Pharo-project] Dumb question: ~ vs. /home/user
Isn't this OS-centric ?
Nicolas
2009/10/4 Randal L. Schwartz <merlyn@stonehenge.com>:
"Wilhelm" == Schwab,Wilhelm K <bschwab@anest.ufl.edu> writes:
Wilhelm> Understood - the question was (is?) whether or not Pharo Wilhelm> should recognize it and act accordingly - I suspect the answer is no.
It *should* be understood and interpreted in the same places where '*' and '?' and '[]' are used for globbing, since it's effectively a globbing character.
So for example, presuming a hypothetical:
 '*.st' matchingFiles
to return everything matching in the default directory, then:
 '~/foo' matchingFiles
should return something relative to the home directory of the current user.
-- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
"Nicolas" == Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com> writes:
Nicolas> mkdir \~ Nicolas> ls -al \~ Nicolas> How will you access this directory from Squeak ? And if you say '\~', then let me do this: mkdir \\\~ :) Evil. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
Am 05.10.2009 um 00:00 schrieb Schwab,Wilhelm K:
Nicolas,
The ~ I have in mind appears only as the first character since it replaces /home/userName, so it might not be a problem. Am I missing something? Yes, ~ is the home of the actual user. But you can also have a user name followed by a ~, like schwab~.
Andreas
"Andreas" == Andreas Wacknitz <A.Wacknitz@gmx.de> writes:
Andreas> Yes, ~ is the home of the actual user. But you can also have a user Andreas> name followed by a ~, like schwab~. Huh? Pretty sure you mean "~schwab", not "schwab~". -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
I concur with the wildcards note. On Oct 4, 2009, at 4:57 PM, Schwab,Wilhelm K wrote:
I think Randall nailed it with wildcards; that's where it fits. I suppose one could provide a Windows version of it (/home/user could map to the documents and settings craziness), though I learned the hard way to steer clear of such things on Windows - if I have to use Windows, give me my own directory on c: any day.
Indeed, '~' was a shell notation, so not an OS feature. And in fact, I used cygwin on windows (for the 12 years I suffered along in that world) and those shells support the tilde (~) and everything you expect from the shells. So it would be nice to support it for all platforms... or not at all. If such features are not going to be supported on all platforms, then I would rely on environmental variables like HOME (or whatever is common across platforms) and simply not use them. -Cam PS: I kicked the windows habit... and cannot for the life of me remember why I suffered along with it even that long. I'm running a mac now, for the last 6 months, and I haven't had a single lock-up or forced re-boot yet.
On Mon, Oct 5, 2009 at 9:23 AM, Randal L. Schwartz <merlyn@stonehenge.com>wrote:
"Wilhelm" == Schwab,Wilhelm K <bschwab@anest.ufl.edu> writes:
Wilhelm> Understood - the question was (is?) whether or not Pharo should Wilhelm> recognize it and act accordingly - I suspect the answer is no.
It *should* be understood and interpreted in the same places where '*' and '?' and '[]' are used for globbing, since it's effectively a globbing character.
So for example, presuming a hypothetical:
'*.st' matchingFiles
to return everything matching in the default directory, then:
'~/foo' matchingFiles
should return something relative to the home directory of the current user.
If I were implementing these I'd put them in a layer of abstraction above FileDirectory and friends; preferably in a separate package. This would also make it work on all OSes. Note that there's quite a few special characters in the userspace commands and they vary from shell to shell. Some of them are quite cool. I like "ls **" which lists a directory tree on some shells. Gulik. -- http://gulik.pbwiki.com/
"Michael" == Michael van der Gulik <mikevdg@gmail.com> writes:
Michael> Note that there's quite a few special characters in the userspace commands Michael> and they vary from shell to shell. Some of them are quite cool. I like "ls Michael> **" which lists a directory tree on some shells. I'd limit any such globbing to "classic" globs (I think they're regulated as part of POSIX), although yes, in reality, I have zsh extendedglobs enabled. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
participants (7)
-
Andreas Wacknitz -
Cameron Sanders -
intrader -
merlyn@stonehenge.com -
Michael van der Gulik -
Nicolas Cellier -
Schwab,Wilhelm K