Squeak 4.5: Files-cmm.131.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Squeak 4.5: Files-cmm.131.mcz

commits-2
Chris Muller uploaded a new version of Files to project Squeak 4.5:
http://source.squeak.org/squeak45/Files-cmm.131.mcz

==================== Summary ====================

Name: Files-cmm.131
Author: cmm
Time: 16 March 2014, 8:32:48.306 pm
UUID: 9a3c6155-2a88-4fb8-b07a-be3743989188
Ancestors: Files-dtl.130

- Extract Levente's improved file-copy from SmalltalkImage>>#appendChangesTo: (into FileDirectory>>#copyFile:toFile:) which honors copy semantics without needing to make assumptions about the streams passed.
- Minor factoring for FileDirectory>>#directoryEntryFor:.
- Add String>>#asDirectoryEntry conversion method.

=============== Diff against Files-dtl.130 ===============

Item was changed:
  ----- Method: FileDirectory>>copyFile:toFile: (in category 'file operations') -----
+ copyFile: fileStream1 toFile: fileStream2
- copyFile: fileStream1 toFile: fileStream2
  | buffer |
+ fileStream1 position: 0.
+ fileStream2 truncate.
  buffer := String new: 50000.
+ [ fileStream1 atEnd ] whileFalse: [ fileStream2 nextPutAll: (fileStream1 nextInto: buffer) ].
+ fileStream2 position < fileStream1 size ifTrue: [ self error: 'File copy failed' ]!
- [fileStream1 atEnd] whileFalse:
- [fileStream2 nextPutAll: (fileStream1 nextInto: buffer)].
- !

Item was changed:
  ----- Method: FileDirectory>>directoryEntryFor: (in category 'enumeration') -----
  directoryEntryFor: filenameOrPath
+ "Answer the directory entry for the given file or path."
+ ^ DirectoryClass
- "Answer the directory entry for the given file or path. Sorta like a poor man's stat()."
- | fName dir |
- DirectoryClass
  splitName: filenameOrPath
+ to:
+ [ : filePath : name | | filename directory |
+ filename := name.
+ directory := filePath isEmpty
+ ifTrue: [ self ]
+ ifFalse: [ FileDirectory on: filePath ].
+ directory
+ entryAt: filename
+ ifAbsent: [ nil ] ]!
- to: [:filePath :name |
- fName := name.
- dir := filePath isEmpty
- ifTrue: [self]
- ifFalse: [FileDirectory on: filePath]].
-
- ^dir exists ifTrue: [dir directoryEntryForName: fName]!

Item was added:
+ ----- Method: String>>asDirectoryEntry (in category '*files') -----
+ asDirectoryEntry
+ ^ FileDirectory directoryEntryFor: self!


Reply | Threaded
Open this post in threaded view
|

Re: Squeak 4.5: Files-cmm.131.mcz

Chris Muller-3
This is only brought into the squeak45 repository because the
updateURL bug causes unwanted packages to be loaded from trunk when
the user selects "Update Squeak" (even though the users updateURL is
set to squeak45).

By bringing in from trunk, it loads in all the way to System-eem.671,
which requires at least Files-cmm.131.

We really need to wrangle this bug, because it essentially means we
can't release 4.5 update patches correctly.

On Tue, May 6, 2014 at 9:51 PM,  <[hidden email]> wrote:

> Chris Muller uploaded a new version of Files to project Squeak 4.5:
> http://source.squeak.org/squeak45/Files-cmm.131.mcz
>
> ==================== Summary ====================
>
> Name: Files-cmm.131
> Author: cmm
> Time: 16 March 2014, 8:32:48.306 pm
> UUID: 9a3c6155-2a88-4fb8-b07a-be3743989188
> Ancestors: Files-dtl.130
>
> - Extract Levente's improved file-copy from SmalltalkImage>>#appendChangesTo: (into FileDirectory>>#copyFile:toFile:) which honors copy semantics without needing to make assumptions about the streams passed.
> - Minor factoring for FileDirectory>>#directoryEntryFor:.
> - Add String>>#asDirectoryEntry conversion method.
>
> =============== Diff against Files-dtl.130 ===============
>
> Item was changed:
>   ----- Method: FileDirectory>>copyFile:toFile: (in category 'file operations') -----
> + copyFile: fileStream1 toFile: fileStream2
> - copyFile: fileStream1 toFile: fileStream2
>         | buffer |
> +       fileStream1 position: 0.
> +       fileStream2 truncate.
>         buffer := String new: 50000.
> +       [ fileStream1 atEnd ] whileFalse: [ fileStream2 nextPutAll: (fileStream1 nextInto: buffer) ].
> +       fileStream2 position < fileStream1 size ifTrue: [ self error: 'File copy failed' ]!
> -       [fileStream1 atEnd] whileFalse:
> -               [fileStream2 nextPutAll: (fileStream1 nextInto: buffer)].
> - !
>
> Item was changed:
>   ----- Method: FileDirectory>>directoryEntryFor: (in category 'enumeration') -----
>   directoryEntryFor: filenameOrPath
> +       "Answer the directory entry for the given file or path."
> +       ^ DirectoryClass
> -       "Answer the directory entry for the given file or path. Sorta like a poor man's stat()."
> -       | fName dir |
> -       DirectoryClass
>                 splitName: filenameOrPath
> +               to:
> +                       [ : filePath : name | | filename directory |
> +                       filename := name.
> +                       directory := filePath isEmpty
> +                               ifTrue: [ self ]
> +                               ifFalse: [ FileDirectory on: filePath ].
> +                        directory
> +                               entryAt: filename
> +                               ifAbsent: [ nil ] ]!
> -               to: [:filePath :name |
> -                       fName := name.
> -                       dir := filePath isEmpty
> -                                       ifTrue: [self]
> -                                       ifFalse: [FileDirectory on: filePath]].
> -
> -       ^dir exists ifTrue: [dir directoryEntryForName: fName]!
>
> Item was added:
> + ----- Method: String>>asDirectoryEntry (in category '*files') -----
> + asDirectoryEntry
> +       ^ FileDirectory directoryEntryFor: self!
>
>