--- a/FileBrowser.st Thu Sep 21 18:31:58 2006 +0200
+++ b/FileBrowser.st Thu Sep 21 18:33:38 2006 +0200
@@ -6629,17 +6629,13 @@
doRename:oldName to:newName
"rename a file (or directory)"
- |old new|
-
- (oldName isNil or:[newName isNil]) ifTrue:[
- ^ self
- ].
- (oldName isBlank or:[newName isBlank]) ifTrue:[
- ^ self
- ].
- (oldName = newName) ifTrue:[
- ^ self
- ].
+ |old new sameFile|
+
+ (oldName isNil or:[newName isNil]) ifTrue:[ ^ self ].
+ (oldName isBlank or:[newName isBlank]) ifTrue:[ ^ self ].
+ (oldName = newName) ifTrue:[ ^ self ].
+
+ sameFile := Filename isCaseSensitive not and:[ oldName sameAs: newName ].
old := currentDirectory filenameFor:oldName.
new := currentDirectory filenameFor:newName.
@@ -6649,11 +6645,13 @@
with:oldName with:newName)
with:(OperatingSystem lastErrorString)
] do:[
- new exists ifTrue:[
- (self confirm:(resources string:'''%1'' already exists - rename (i.e. overwrite) anyway ?' with:new baseName allBold))
- ifFalse:[
- ^ self
- ]
+ sameFile ifFalse:[
+ new exists ifTrue:[
+ (self confirm:(resources string:'''%1'' already exists - rename (i.e. overwrite) anyway ?' with:new baseName allBold))
+ ifFalse:[
+ ^ self
+ ]
+ ].
].
old renameTo:new.
].
@@ -6661,8 +6659,8 @@
self updateCurrentDirectory
"/ self updateCurrentDirectoryIfChanged.
- "Modified: / 24.9.1997 / 09:20:00 / stefan"
- "Modified: / 16.11.2001 / 00:44:27 / cg"
+ "Modified: / 24-09-1997 / 09:20:00 / stefan"
+ "Modified: / 21-09-2006 / 18:34:45 / cg"
! !
!FileBrowser methodsFor:'private-file type & info'!
@@ -7500,5 +7498,5 @@
!FileBrowser class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/FileBrowser.st,v 1.616 2006-09-21 14:27:11 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/FileBrowser.st,v 1.617 2006-09-21 16:33:38 cg Exp $'
! !