--- a/DropObject.st Sun Mar 15 05:12:03 2009 +0100
+++ b/DropObject.st Tue Mar 17 10:33:28 2009 +0100
@@ -432,17 +432,19 @@
!
isPrintable
- "return false if file contains nonprintable characters"
+ "return true if file contains only printable characters (in the first 300 bytes)"
- |stream buff size|
+ |nChars stream buff size|
+
+ nChars := 300.
isPrintable isNil ifTrue:[
isPrintable := false.
(info isNil or:[ self isDirectory ]) ifFalse:[
stream := theObject readStreamOrNil.
stream notNil ifTrue:[
- buff := String new:300.
- size := stream nextBytes:300 into:buff.
+ buff := String new:nChars.
+ size := stream nextBytes:nChars into:buff.
stream close.
1 to:size do:[:i |
(buff at:i) isPrintable ifFalse:[
@@ -522,5 +524,5 @@
!DropObject class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview2/DropObject.st,v 1.18 2009-01-14 20:55:24 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview2/DropObject.st,v 1.19 2009-03-17 09:33:28 cg Exp $'
! !