FileOperations.st
author penk
Tue, 03 Sep 2002 17:23:22 +0200
changeset 1585 91ec771207a2
child 1588 6dde5ad32643
permissions -rw-r--r--
initial checkin

"{ Package: 'stx:libtool2' }"

Object subclass:#FileOperations
	instanceVariableNames:'errorString result'
	classVariableNames:''
	poolDictionaries:''
	category:'Interface-Support'
!


!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
    | 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.
        ^ (Dialog confirm:(string)).
    ].
    ^ true
! !

!FileOperations class methodsFor:'documentation'!

version
    ^ '$Header$'
! !