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 [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
>>>>> "Wilhelm" == Schwab,Wilhelm K <[hidden email]> 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 <[hidden email]> <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 [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Schwab,Wilhelm K
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 > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
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: [hidden email] [mailto:[hidden email]] On Behalf Of intrader Sent: Sunday, October 04, 2009 2:03 PM To: [hidden email] 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 > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
>>>>> "Wilhelm" == Schwab,Wilhelm K <[hidden email]> 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 <[hidden email]> <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 [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Isn't this OS-centric ?
Nicolas 2009/10/4 Randal L. Schwartz <[hidden email]>: >>>>>> "Wilhelm" == Schwab,Wilhelm K <[hidden email]> 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 > <[hidden email]> <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 > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Randal L. Schwartz
On Mon, Oct 5, 2009 at 9:23 AM, Randal L. Schwartz <[hidden email]> wrote: >>>>> "Wilhelm" == Schwab,Wilhelm K <[hidden email]> writes: 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/ _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Nicolas Cellier
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: [hidden email] [mailto:[hidden email]] On Behalf Of Nicolas Cellier Sent: Sunday, October 04, 2009 3:28 PM To: [hidden email] Subject: Re: [Pharo-project] Dumb question: ~ vs. /home/user Isn't this OS-centric ? Nicolas 2009/10/4 Randal L. Schwartz <[hidden email]>: >>>>>> "Wilhelm" == Schwab,Wilhelm K <[hidden email]> 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 <[hidden email]> <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 > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Michael van der Gulik-2
>>>>> "Michael" == Michael van der Gulik <[hidden email]> 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 <[hidden email]> <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 [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Schwab,Wilhelm K
If you follow that path, don't forget we might require a way to escape '\~'
Nicolas 2009/10/4 Schwab,Wilhelm K <[hidden email]>: > 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: [hidden email] [mailto:[hidden email]] On Behalf Of Nicolas Cellier > Sent: Sunday, October 04, 2009 3:28 PM > To: [hidden email] > Subject: Re: [Pharo-project] Dumb question: ~ vs. /home/user > > Isn't this OS-centric ? > > Nicolas > > 2009/10/4 Randal L. Schwartz <[hidden email]>: >>>>>>> "Wilhelm" == Schwab,Wilhelm K <[hidden email]> 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 <[hidden email]> <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 >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > _______________________________________________ Pharo-project mailing list [hidden email] 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: [hidden email] [mailto:[hidden email]] On Behalf Of Nicolas Cellier Sent: Sunday, October 04, 2009 4:05 PM To: [hidden email] 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 <[hidden email]>: > 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: [hidden email] > [mailto:[hidden email]] On Behalf Of > Nicolas Cellier > Sent: Sunday, October 04, 2009 3:28 PM > To: [hidden email] > Subject: Re: [Pharo-project] Dumb question: ~ vs. /home/user > > Isn't this OS-centric ? > > Nicolas > > 2009/10/4 Randal L. Schwartz <[hidden email]>: >>>>>>> "Wilhelm" == Schwab,Wilhelm K <[hidden email]> 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 <[hidden email]> <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 >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] 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 <[hidden email]>: > 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: [hidden email] [mailto:[hidden email]] On Behalf Of Nicolas Cellier > Sent: Sunday, October 04, 2009 4:05 PM > To: [hidden email] > 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 <[hidden email]>: >> 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: [hidden email] >> [mailto:[hidden email]] On Behalf Of >> Nicolas Cellier >> Sent: Sunday, October 04, 2009 3:28 PM >> To: [hidden email] >> Subject: Re: [Pharo-project] Dumb question: ~ vs. /home/user >> >> Isn't this OS-centric ? >> >> Nicolas >> >> 2009/10/4 Randal L. Schwartz <[hidden email]>: >>>>>>>> "Wilhelm" == Schwab,Wilhelm K <[hidden email]> 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 <[hidden email]> <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 >>> [hidden email] >>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >>> >> >> _______________________________________________ >> Pharo-project mailing list >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> >> _______________________________________________ >> Pharo-project mailing list >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Schwab,Wilhelm K
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 _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Schwab,Wilhelm K
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. _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Andreas Wacknitz
>>>>> "Andreas" == Andreas Wacknitz <[hidden email]> 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 <[hidden email]> <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 [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Nicolas Cellier
>>>>> "Nicolas" == Nicolas Cellier <[hidden email]> 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 <[hidden email]> <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 [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Free forum by Nabble | Edit this page |