Chris Muller uploaded a new version of Files to project The Trunk:
http://source.squeak.org/trunk/Files-cmm.159.mcz ==================== Summary ==================== Name: Files-cmm.159 Author: cmm Time: 21 July 2016, 3:44:04.16263 pm UUID: 52077283-7106-4ab6-8368-d5f4b5f6f641 Ancestors: Files-eem.158 Fix FileDirectory>>#/ to not assume the argument represents another directory; it could be a file. =============== Diff against Files-eem.158 =============== Item was changed: ----- Method: FileDirectory>>/ (in category 'path access') ----- / aString "Answer a FileDirectory on a subdirectory named aString, of the receiver." + ^ FileDirectory directoryEntryFor: (self fullNameFor: aString)! - ^ FileDirectory on: (self fullNameFor: aString)! |
This does change the return type in the case of a directory from a
FileDirectory to a DirectoryEntryDirectory. The intention is to gradually migrate most of FileDirectory's public api to DirectoryEntryDirectory, and let FileDirectory be concerned with the platform-specific access issues. In the meantime, the most compatible thing to do for backward compatibility with the old #/ is to send #asFileDirectory to the result. On Thu, Jul 21, 2016 at 3:44 PM, <[hidden email]> wrote: > Chris Muller uploaded a new version of Files to project The Trunk: > http://source.squeak.org/trunk/Files-cmm.159.mcz > > ==================== Summary ==================== > > Name: Files-cmm.159 > Author: cmm > Time: 21 July 2016, 3:44:04.16263 pm > UUID: 52077283-7106-4ab6-8368-d5f4b5f6f641 > Ancestors: Files-eem.158 > > Fix FileDirectory>>#/ to not assume the argument represents another directory; it could be a file. > > =============== Diff against Files-eem.158 =============== > > Item was changed: > ----- Method: FileDirectory>>/ (in category 'path access') ----- > / aString > "Answer a FileDirectory on a subdirectory named aString, of the receiver." > + ^ FileDirectory directoryEntryFor: (self fullNameFor: aString)! > - ^ FileDirectory on: (self fullNameFor: aString)! > > |
On 21.07.2016, at 22:57, Chris Muller <[hidden email]> wrote: > This does change the return type in the case of a directory from a > FileDirectory to a DirectoryEntryDirectory. > > The intention is to gradually migrate most of FileDirectory's public > api to DirectoryEntryDirectory, and let FileDirectory be concerned > with the platform-specific access issues. > > In the meantime, the most compatible thing to do for backward > compatibility with the old #/ is to send #asFileDirectory to the > result. I'm not ok with this change. It makes FileDirectory default / 'myDir' / 'aSubDir' oldFileNamed: 'foo' do: [:stream | ..] unduly complex. If we were about to migrate, we should migrate to FileSytem, I'd say. :) best regards -Tobias > > > On Thu, Jul 21, 2016 at 3:44 PM, <[hidden email]> wrote: >> Chris Muller uploaded a new version of Files to project The Trunk: >> http://source.squeak.org/trunk/Files-cmm.159.mcz >> >> ==================== Summary ==================== >> >> Name: Files-cmm.159 >> Author: cmm >> Time: 21 July 2016, 3:44:04.16263 pm >> UUID: 52077283-7106-4ab6-8368-d5f4b5f6f641 >> Ancestors: Files-eem.158 >> >> Fix FileDirectory>>#/ to not assume the argument represents another directory; it could be a file. >> >> =============== Diff against Files-eem.158 =============== >> >> Item was changed: >> ----- Method: FileDirectory>>/ (in category 'path access') ----- >> / aString >> "Answer a FileDirectory on a subdirectory named aString, of the receiver." >> + ^ FileDirectory directoryEntryFor: (self fullNameFor: aString)! >> - ^ FileDirectory on: (self fullNameFor: aString)! |
Hi Tobias, this is just a fix, not a change. The 2007 refactor was
intended for applications to migrate to the use of the DirectoryEntry hierarchy, so you can (and should) now write this instead: FileDirectory default / 'myDir' / 'aSubDir' / 'foo' readWriteStreamDo: [:stream | ..] The intent always was to add them lazily, as needed. I have just committed that along with one of my other recent improvements. Best, Chris On Thu, Jul 21, 2016 at 4:06 PM, Tobias Pape <[hidden email]> wrote: > > On 21.07.2016, at 22:57, Chris Muller <[hidden email]> wrote: > >> This does change the return type in the case of a directory from a >> FileDirectory to a DirectoryEntryDirectory. >> >> The intention is to gradually migrate most of FileDirectory's public >> api to DirectoryEntryDirectory, and let FileDirectory be concerned >> with the platform-specific access issues. >> >> In the meantime, the most compatible thing to do for backward >> compatibility with the old #/ is to send #asFileDirectory to the >> result. > > > I'm not ok with this change. > > It makes > > FileDirectory default / 'myDir' / 'aSubDir' oldFileNamed: 'foo' do: [:stream | ..] > > unduly complex. > If we were about to migrate, we should migrate to FileSytem, I'd say. :) > > best regards > -Tobias > >> >> >> On Thu, Jul 21, 2016 at 3:44 PM, <[hidden email]> wrote: >>> Chris Muller uploaded a new version of Files to project The Trunk: >>> http://source.squeak.org/trunk/Files-cmm.159.mcz >>> >>> ==================== Summary ==================== >>> >>> Name: Files-cmm.159 >>> Author: cmm >>> Time: 21 July 2016, 3:44:04.16263 pm >>> UUID: 52077283-7106-4ab6-8368-d5f4b5f6f641 >>> Ancestors: Files-eem.158 >>> >>> Fix FileDirectory>>#/ to not assume the argument represents another directory; it could be a file. >>> >>> =============== Diff against Files-eem.158 =============== >>> >>> Item was changed: >>> ----- Method: FileDirectory>>/ (in category 'path access') ----- >>> / aString >>> "Answer a FileDirectory on a subdirectory named aString, of the receiver." >>> + ^ FileDirectory directoryEntryFor: (self fullNameFor: aString)! >>> - ^ FileDirectory on: (self fullNameFor: aString)! > > |
In reply to this post by Chris Muller-3
Hi Chris, please watch out for the feature freeze deadline, which is a good week from today. Either ensure that you can finish this migration in time or do it so that no other code breaks. Changing the return type of a call is a serious thing. :-) Thanks. Best, Marcel |
Free forum by Nabble | Edit this page |