Hi all,
Currently:
(FSPath / 'foo.bar.zot') extension = 'bar.zot'
Should it be? I expected it to equal 'zot'.
For reference, in python3:
os.path.splitext('foo.bar.zot') == ('foo.bar', '.zot')
and in racket
(equal? (path-get-extension "foo.bar.zot") #".zot")
Tony
Good catch! That's clearly a bug IMO. #extension should use #copyAfterLast: rather than #copyAfter:.
On the other, FSReferenceTest >> #testBaseAndExtension explicitly defines a test where it says:
"Note that the extension of a complex extension starts from the first period up until the end"
http://www.hpi.de/ So why is Squeak-FileSystem neglecting the common standards in this case?
Best, Christoph ________________________________ Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Tony Garnock-Jones tonyg@leastfixedpoint.com Gesendet: Donnerstag, 5. November 2020 19:31:44 An: The general-purpose Squeak developers list Betreff: [squeak-dev] (FSPath / 'foo.bar.zot') extension = 'bar.zot'
Hi all,
Currently:
(FSPath / 'foo.bar.zot') extension = 'bar.zot'
Should it be? I expected it to equal 'zot'.
For reference, in python3:
os.path.splitext('foo.bar.zot') == ('foo.bar', '.zot')
and in racket
(equal? (path-get-extension "foo.bar.zot") #".zot")
Tony
On 11/5/20 7:41 PM, Thiede, Christoph wrote:
Good catch! That's clearly a bug IMO. #extension should use #copyAfterLast: rather than #copyAfter:.
On the other, FSReferenceTest >> #testBaseAndExtension explicitly defines a test where it says:
"Note that the extension of a complex extension starts from the first period up until the end"
Worse, it's inconsistent with #withExtension: -
((FSPath / 'foo.bar.zot') withExtension: 'zaz') = (FSPath / 'foo.bar.zaz')
!!!
On 11/5/20 7:43 PM, tim Rowledge wrote:
For the 'normal' FileDirectory stuff in the image, the extension would work ok here. I'm not familiar with FSPath - that's the package Colin Putney wrote a while back?
This is part of package FS-Core that the Squeak config wizard loads as part of the Git support.
Tony
On Thu, Nov 05, 2020 at 06:41:14PM +0000, Thiede, Christoph wrote:
Good catch! That's clearly a bug IMO. #extension should use #copyAfterLast: rather than #copyAfter:.
On the other, FSReferenceTest >> #testBaseAndExtension explicitly defines a test where it says:
"Note that the extension of a complex extension starts from the first period up until the end"
The underlying problem appears to be that someone neglected to write a test for #extension.
The testBaseAndExtension test appears to be a later addition, and it may be that the test simply documents an existing bug, so the test itself may be wrong.
I am attaching a proposed test based on Tony's example.
Dave
Am Do., 5. Nov. 2020 um 19:41 Uhr schrieb Thiede, Christoph Christoph.Thiede@student.hpi.uni-potsdam.de:
Good catch! That's clearly a bug IMO. #extension should use #copyAfterLast: rather than #copyAfter:.
Pharo has it like this as well, so it is also an unnecessary incompatibility:
extension "Return the extension of path basename i.e., /foo/gloops.taz extension is 'taz'" ^ self basename copyAfterLast: self extensionDelimiter
On the other, FSReferenceTest >> #testBaseAndExtension explicitly defines a test where it says:
"Note that the extension of a complex extension starts from the first period up until the end"
The original author might either have just documented that status quo, or thought of something like .tar.gz. Again Pharo has changed this to "Note that the extension of a complex extension starts after the last extension delimiter".
I am attaching a proposed test based on Tony's example.
+1! Are there any objections or shall we integrate this change into Squeak-FileSystem?
Best, Christoph
________________________________ Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Jakob Reschke forums.jakob@resfarm.de Gesendet: Freitag, 6. November 2020 12:31:03 An: The general-purpose Squeak developers list Betreff: Re: [squeak-dev] (FSPath / 'foo.bar.zot') extension = 'bar.zot'
Am Do., 5. Nov. 2020 um 19:41 Uhr schrieb Thiede, Christoph Christoph.Thiede@student.hpi.uni-potsdam.de:
Good catch! That's clearly a bug IMO. #extension should use #copyAfterLast: rather than #copyAfter:.
Pharo has it like this as well, so it is also an unnecessary incompatibility:
extension "Return the extension of path basename i.e., /foo/gloops.taz extension is 'taz'" ^ self basename copyAfterLast: self extensionDelimiter
On the other, FSReferenceTest >> #testBaseAndExtension explicitly defines a test where it says:
"Note that the extension of a complex extension starts from the first period up until the end"
The original author might either have just documented that status quo, or thought of something like .tar.gz. Again Pharo has changed this to "Note that the extension of a complex extension starts after the last extension delimiter".
Am Sa., 7. Nov. 2020 um 13:54 Uhr schrieb Thiede, Christoph Christoph.Thiede@student.hpi.uni-potsdam.de:
Are there any objections or shall we integrate this change into Squeak-FileSystem?
In my opinion, go ahead, but check and at least post the senders that need to be changed, please.
On 11/7/20 3:54 PM, Jakob Reschke wrote:
Am Sa., 7. Nov. 2020 um 13:54 Uhr schrieb Thiede, Christoph Christoph.Thiede@student.hpi.uni-potsdam.de:
Are there any objections or shall we integrate this change into Squeak-FileSystem?
In my opinion, go ahead, but check and at least post the senders that need to be changed, please.
I don't see any senders (that need changing) at all in my current trunk-ish image. Are there external packages that need to be looked at or is it good enough to have trunk be OK for the change?
Tony
Trunk and FileSystem-Git + Squot. Christoph probably has these loaded anyway.
Am Mo., 9. Nov. 2020 um 13:38 Uhr schrieb Tony Garnock-Jones tonyg@leastfixedpoint.com:
On 11/7/20 3:54 PM, Jakob Reschke wrote:
Am Sa., 7. Nov. 2020 um 13:54 Uhr schrieb Thiede, Christoph Christoph.Thiede@student.hpi.uni-potsdam.de:
Are there any objections or shall we integrate this change into Squeak-FileSystem?
In my opinion, go ahead, but check and at least post the senders that need to be changed, please.
I don't see any senders (that need changing) at all in my current trunk-ish image. Are there external packages that need to be looked at or is it good enough to have trunk be OK for the change?
Tony
On 11/11/20 11:16 AM, Jakob Reschke wrote:
Trunk and FileSystem-Git + Squot. Christoph probably has these loaded anyway.
The versions of those I have loaded are the ones installed by the configuration wizard (ie master of Squot and its support libraries) - and there are no interesting senders of #extension there.
So I think we're probably OK to make the change!
Tony
Alright, Tony, will you submit a PR, or shall I do that? :-)
Best, Christoph ________________________________ Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Tony Garnock-Jones tonyg@leastfixedpoint.com Gesendet: Mittwoch, 11. November 2020 19:25:59 An: Jakob Reschke Cc: The general-purpose Squeak developers list Betreff: Re: [squeak-dev] (FSPath / 'foo.bar.zot') extension = 'bar.zot'
On 11/11/20 11:16 AM, Jakob Reschke wrote:
Trunk and FileSystem-Git + Squot. Christoph probably has these loaded anyway.
The versions of those I have loaded are the ones installed by the configuration wizard (ie master of Squot and its support libraries) - and there are no interesting senders of #extension there.
So I think we're probably OK to make the change!
Tony
Took me only 13 months, here you are: https://github.com/squeak-smalltalk/squeak-filesystem/pull/9
Can anyone with access rights merge this? :-)
Best, Christoph
--- Sent from Squeak Inbox Talk
On 2020-11-16T15:33:38+00:00, christoph.thiede@student.hpi.uni-potsdam.de wrote:
Alright, Tony, will you submit a PR, or shall I do that? :-)
Best, Christoph ________________________________ Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Tony Garnock-Jones <tonyg at leastfixedpoint.com> Gesendet: Mittwoch, 11. November 2020 19:25:59 An: Jakob Reschke Cc: The general-purpose Squeak developers list Betreff: Re: [squeak-dev] (FSPath / 'foo.bar.zot') extension = 'bar.zot'
On 11/11/20 11:16 AM, Jakob Reschke wrote:
Trunk and FileSystem-Git + Squot. Christoph probably has these loaded anyway.
The versions of those I have loaded are the ones installed by the configuration wizard (ie master of Squot and its support libraries) - and there are no interesting senders of #extension there.
So I think we're probably OK to make the change!
Tony
Am Mi., 29. Dez. 2021 um 20:54 Uhr schrieb christoph.thiede@student.hpi.uni-potsdam.de:
Took me only 13 months, here you are: https://github.com/squeak-smalltalk/squeak-filesystem/pull/9
Can anyone with access rights merge this? :-)
Me pressing the merge button took a little less time. ;-)
On 2020-11-05, at 10:31 AM, Tony Garnock-Jones tonyg@leastfixedpoint.com wrote:
Hi all,
Currently:
(FSPath / 'foo.bar.zot') extension = 'bar.zot'
Should it be? I expected it to equal 'zot'.
For the 'normal' FileDirectory stuff in the image, the extension would work ok here. I'm not familiar with FSPath - that's the package Colin Putney wrote a while back?
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim I came, I saw, I deleted all your files.
On Thu, Nov 05, 2020 at 10:43:02AM -0800, tim Rowledge wrote:
On 2020-11-05, at 10:31 AM, Tony Garnock-Jones tonyg@leastfixedpoint.com wrote:
Hi all,
Currently:
(FSPath / 'foo.bar.zot') extension = 'bar.zot'
Should it be? I expected it to equal 'zot'.
For the 'normal' FileDirectory stuff in the image, the extension would work ok here. I'm not familiar with FSPath - that's the package Colin Putney wrote a while back?
Yes (although the version history seems to show other authors). It gets pulled in along with the git tools.
It is on GitHub at https://github.com/squeak-smalltalk/squeak-filesystem which is based on the earlier work at http://www.squeaksource.com/fs
Dave
squeak-dev@lists.squeakfoundation.org