"{ Package: 'stx:libtool2' }"
Object subclass:#FileOperations
instanceVariableNames:'errorString result'
classVariableNames:''
poolDictionaries:''
category:'Interface-Support'
!
!FileOperations class methodsFor:'defaults'!
copyMoveIfExistSuffixString
^ '.copy'
! !
!FileOperations methodsFor:'accessing'!
errorString
"return the value of the static variable 'ErrorString' (automatically generated)"
^ errorString
!
errorString:something
"set the value of the static variable 'ErrorString' (automatically generated)"
errorString := something.
!
result
"return the value of the instance variable 'result' (automatically generated)"
^ result
!
result:something
"set the value of the instance variable 'result' (automatically generated)"
result := something.
! !
!FileOperations methodsFor:'dialogs'!
fileExistDialogFor:aFile
^ self fileExistDialogFor:aFile withCancel:false.
!
fileExistDialogFor:aFile withCancel:aBoolean
| stream string|
aFile exists ifTrue:[
stream := WriteStream on:''.
stream nextPutAll:'overwrite '.
stream nextPutAll:(aFile asString).
stream nextPutAll:' from '.
(aFile modificationTime) printOn:stream format:'%(Day)-%(mon)-%(year) %h:%m:%s'.
stream nextPutAll:' with size of '.
stream nextPutAll:aFile fileSize asString.
stream cr.
stream nextPutAll:' with '.
stream nextPutAll:aFile asString.
stream nextPutAll:' from '.
(aFile modificationTime) printOn:stream format:'%(Day)-%(mon)-%(year) %h:%m:%s'.
stream nextPutAll:' with size of '.
stream nextPutAll:aFile fileSize asString.
string := stream contents.
stream close.
aBoolean ifTrue:[
^ (Dialog confirmWithCancel:(string)).
] ifFalse:[
^ (Dialog confirm:(string)).
].
].
^ true
! !
!FileOperations class methodsFor:'documentation'!
version
^ '$Header$'
! !