The Trunk: Files-nice.71.mcz

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

The Trunk: Files-nice.71.mcz

commits-2
Nicolas Cellier uploaded a new version of Files to project The Trunk:
http://source.squeak.org/trunk/Files-nice.71.mcz

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

Name: Files-nice.71
Author: nice
Time: 6 March 2010, 9:37:09.562 pm
UUID: 226a7797-6709-1648-8648-ea7723f3e6aa
Ancestors: Files-ul.70

1) Move File exceptions to Files package
2) Integrate FileWriteError from Cuis

=============== Diff against Files-ul.70 ===============

Item was changed:
  ----- Method: StandardFileStream>>primWrite:from:startingAt:count: (in category 'primitives') -----
  primWrite: id from: stringOrByteArray startingAt: startIndex count: count
  "Write count bytes onto this file from the given string or byte array starting at the given index. Answer the number of bytes written."
 
  <primitive: 'primitiveFileWrite' module: 'FilePlugin'>
+ (FileWriteError fileName: name)
+ signal: (self closed
+ ifTrue: [ 'File ', name, ' is closed' ]
+ ifFalse: [ 'File ', name, 'write failed' ])!
- self closed ifTrue: [^ self error: 'File is closed'].
- self error: 'File write failed'.
- !

Item was added:
+ ----- Method: FileStreamException>>isResumable (in category 'exceptionDescription') -----
+ isResumable
+ "Determine whether an exception is resumable."
+
+ ^true!

Item was added:
+ ----- Method: FileStreamException>>fileName (in category 'exceptionDescription') -----
+ fileName
+ ^fileName!

Item was added:
+ FileStreamException subclass: #FileExistsException
+ instanceVariableNames: 'fileClass'
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'Files-Exceptions'!

Item was added:
+ ----- Method: FileDoesNotExistException>>readOnly: (in category 'accessing') -----
+ readOnly: aBoolean
+ readOnly := aBoolean!

Item was added:
+ FileStreamException subclass: #FileWriteError
+ instanceVariableNames: ''
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'Files-Exceptions'!

Item was added:
+ ----- Method: FileDoesNotExistException class>>example (in category 'examples') -----
+ example
+ "FileDoesNotExistException example"
+
+ | result |
+ result := [(StandardFileStream readOnlyFileNamed: 'error42.log') contentsOfEntireFile]
+ on: FileDoesNotExistException
+ do: [:ex | 'No error log'].
+ Transcript show: result; cr!

Item was added:
+ ----- Method: FileDoesNotExistException>>readOnly (in category 'accessing') -----
+ readOnly
+ ^readOnly == true!

Item was added:
+ ----- Method: FileStreamException>>messageText (in category 'exceptionDescription') -----
+ messageText
+
+ "Return an exception's message text."
+
+ ^messageText == nil
+ ifTrue: [fileName printString]
+ ifFalse: [messageText]!

Item was added:
+ ----- Method: FileExistsException>>fileClass: (in category 'accessing') -----
+ fileClass: aClass
+ fileClass := aClass!

Item was added:
+ ----- Method: FileExistsException>>fileClass (in category 'accessing') -----
+ fileClass
+ ^ fileClass ifNil: [StandardFileStream]!

Item was changed:
  SystemOrganization addCategory: #'Files-Directories'!
+ SystemOrganization addCategory: #'Files-Exceptions'!
  SystemOrganization addCategory: #'Files-Kernel'!
  SystemOrganization addCategory: #'Files-System'!

Item was added:
+ ----- Method: FileStreamException>>fileName: (in category 'exceptionBuilder') -----
+ fileName: aFileName
+ fileName := aFileName!

Item was added:
+ ----- Method: FileDoesNotExistException>>defaultAction (in category 'exceptionDescription') -----
+ defaultAction
+ "The default action taken if the exception is signaled."
+
+
+ ^self readOnly
+ ifTrue: [StandardFileStream readOnlyFileDoesNotExistUserHandling: self fileName]
+ ifFalse: [StandardFileStream fileDoesNotExistUserHandling: self fileName]
+ !

Item was added:
+ ----- Method: FileStreamException class>>fileName: (in category 'exceptionInstantiator') -----
+ fileName: aFileName
+ ^self new fileName: aFileName!

Item was added:
+ FileStreamException subclass: #CannotDeleteFileException
+ instanceVariableNames: ''
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'Files-Exceptions'!

Item was added:
+ ----- Method: FileExistsException>>defaultAction (in category 'exceptionDescription') -----
+ defaultAction
+ "The default action taken if the exception is signaled."
+
+ ^ self fileClass fileExistsUserHandling: self fileName
+ !

Item was added:
+ ----- Method: FileExistsException class>>fileName:fileClass: (in category 'exceptionInstantiator') -----
+ fileName: aFileName fileClass: aClass
+ ^ self new
+ fileName: aFileName;
+ fileClass: aClass!

Item was added:
+ Error subclass: #FileStreamException
+ instanceVariableNames: 'fileName'
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'Files-Exceptions'!

Item was added:
+ FileStreamException subclass: #FileDoesNotExistException
+ instanceVariableNames: 'readOnly'
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'Files-Exceptions'!