Re: Issue 5870 in pharo: [BUG] FileSystem>>rename:to: causes DNU

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

Re: Issue 5870 in pharo: [BUG] FileSystem>>rename:to: causes DNU

pharo
Updates:
        Summary: [BUG] FileSystem>>rename:to: causes DNU
        Status: FixReviewNeeded

Comment #1 on issue 5870 by [hidden email]: [BUG]  
FileSystem>>rename:to: causes DNU
http://code.google.com/p/pharo/issues/detail?id=5870

The original issue name was "...FileReference>>rename:to:...", should  
be "...FileSystem>>rename:to:..."

Fix in inbox:  
SLICE-Issue-5870-BUG-FileReferencegtgtrenameto-causes-DNU-SeanDeNigris.1

1. Fix DNU raised by following test. This test still fails (it should be  
with current implementation):
Name
2. Still unresolved - instead of raising the expected exception (see  
FileSystem>>rename:to:), silently replaces the existing file - yikes!  
Should the check for an existing file be in the image or VM, which also  
happily does an unchecked rename?

testRenameTargetExists

        | existingFile fileToRename |
        [
                existingFile := 'existingFile' asFile ensureFile.
                fileToRename := 'fileToRename' asFile ensureFile.
                self should: [ fileToRename renameTo: existingFile fullName ] raise:  
FileExists ]
                ensure: [
                        existingFile delete.
                        fileToRename delete ].


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5870 in pharo: [BUG] FileSystem>>rename:to: causes DNU

pharo
Updates:
        Labels: Milestone-2.0

Comment #2 on issue 5870 by [hidden email]: [BUG]  
FileSystem>>rename:to: causes DNU
http://code.google.com/p/pharo/issues/detail?id=5870

(No comment was entered for this change.)


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5870 in pharo: [BUG] FileSystem>>rename:to: causes DNU

pharo

Comment #3 on issue 5870 by [hidden email]: [BUG]  
FileSystem>>rename:to: causes DNU
http://code.google.com/p/pharo/issues/detail?id=5870

It seems the primitive has changed it's behavior...  From the comment, it  
is supposed to do:

rename: oldFileFullName to: newFileFullName
        "Rename the file of the given name to the new name. Fail if there is no  
file of the old name
        or if there is an existing file with the new name."

But it is overriding the file. I propose by now to move the check before  
the primitive call. I'll post a new version of the slice.


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5870 in pharo: [BUG] FileSystem>>rename:to: causes DNU

pharo
Updates:
        Status: NextActionNeeded

Comment #4 on issue 5870 by [hidden email]: [BUG]  
FileSystem>>rename:to: causes DNU
http://code.google.com/p/pharo/issues/detail?id=5870

SLICE-Issue-5870-BUG-FileReferencegtgtrenameto-causes-DNU-GuillermoPolito.2

Should do it.  I'd wait for people's answer in the mailing list to move it  
to include.


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5870 in pharo: [BUG] FileSystem>>rename:to: causes DNU

pharo
Updates:
        Labels: Filesystem

Comment #5 on issue 5870 by [hidden email]: [BUG]  
FileSystem>>rename:to: causes DNU
http://code.google.com/p/pharo/issues/detail?id=5870

(No comment was entered for this change.)


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5870 in pharo: [BUG] FileSystem>>rename:to: causes DNU

pharo
Updates:
        Status: FixReviewNeeded

Comment #6 on issue 5870 by [hidden email]: [BUG]  
FileSystem>>rename:to: causes DNU
http://code.google.com/p/pharo/issues/detail?id=5870

(No comment was entered for this change.)


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5870 in pharo: [BUG] FileSystem>>rename:to: causes DNU

pharo
Updates:
        Status: MonkeyIsChecking

Comment #7 on issue 5870 by [hidden email]: [BUG]  
FileSystem>>rename:to: causes DNU
http://code.google.com/p/pharo/issues/detail?id=5870#c7

The Monkey is currently checking this issue. Please don't change it!


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5870 in pharo: [BUG] FileSystem>>rename:to: causes DNU

pharo
Updates:
        Status: WorkNeeded

Comment #8 on issue 5870 by [hidden email]: [BUG]  
FileSystem>>rename:to: causes DNU
http://code.google.com/p/pharo/issues/detail?id=5870#c8

Monkey went bananas:
--------------------
Error while loading  
SLICE-Issue-5870-BUG-FileReferencegtgtrenameto-causes-DNU-GuillermoPolito.2  
from http://ss3.gemstone.com/ss/PharoInbox:
        UndeclaredVariableWarning
  1: EncoderForV3PlusClosures(Encoder)>>undeclared:
  2: Parser>>correctVariable:interval:
  3: [self
                        correctVariable: varName
                        interval: (varStart to: varEnd)] in Parser>>variable
  4: [(self
                                lookupInPools: name
                                ifFound: [:assoc | varNode := self global: assoc name: name])
                        ifTrue: [varNode]
                        ifFalse: [^ action value]] in  
EncoderForV3PlusClosures(Encoder)>>encodeVariable:sourceRange:ifUnknown:
  5: Dictionary>>at:ifAbsent:
  6: EncoderForV3PlusClosures(Encoder)>>encodeVariable:sourceRange:ifUnknown:
  7: Parser>>variable
  8: Parser>>primaryExpression
  9: Parser>>expression
10: Parser>>statements:innerBlock:blockNode:
        ...
----------------------------------------------------------
Loaded Source:  
SLICE-Issue-5870-BUG-FileReferencegtgtrenameto-causes-DNU-GuillermoPolito.2  
from http://ss3.gemstone.com/ss/PharoInbox
Tested using Pharo-2.0-20172-a on CoInterpreter  
VMMaker-oscog-EstebanLorenzano.160 uuid:  
bec8cdf0-4e06-4975-8c02-e882fadf4df3 Jun 22 2012,  
StackToRegisterMappingCogit VMMaker-oscog-EstebanLorenzano.160 uuid:  
bec8cdf0-4e06-4975-8c02-e882fadf4df3 Jun 22 2012,  
https://git.gitorious.org/cogvm/blessed.git Commit:  
744bfe905c78a1a5d408680a8780367ea77e0549 Date: Fri Jun 1 15:17:41 2012  
+0200 By: Esteban Lorenzano <[hidden email]>


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5870 in pharo: [BUG] FileSystem>>rename:to: causes DNU

pharo
Updates:
        Status: FixReviewNeeded

Comment #9 on issue 5870 by [hidden email]: [BUG]  
FileSystem>>rename:to: causes DNU
http://code.google.com/p/pharo/issues/detail?id=5870

Monkey, when I load it I have no problem... try again!


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5870 in pharo: [BUG] FileSystem>>rename:to: causes DNU

pharo
Updates:
        Status: MonkeyIsChecking

Comment #10 on issue 5870 by [hidden email]: [BUG]  
FileSystem>>rename:to: causes DNU
http://code.google.com/p/pharo/issues/detail?id=5870#c10

The Monkey is currently checking this issue. Please don't change it!


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5870 in pharo: [BUG] FileSystem>>rename:to: causes DNU

pharo
Updates:
        Status: WorkNeeded

Comment #11 on issue 5870 by [hidden email]: [BUG]  
FileSystem>>rename:to: causes DNU
http://code.google.com/p/pharo/issues/detail?id=5870#c11

Monkey went bananas:
--------------------
Error while loading  
SLICE-Issue-5870-BUG-FileReferencegtgtrenameto-causes-DNU-GuillermoPolito.2  
from http://ss3.gemstone.com/ss/PharoInbox:
        UndeclaredVariableWarning
  1: EncoderForV3PlusClosures(Encoder)>>undeclared:
  2: Parser>>correctVariable:interval:
  3: [self
                        correctVariable: varName
                        interval: (varStart to: varEnd)] in Parser>>variable
  4: [(self
                                lookupInPools: name
                                ifFound: [:assoc | varNode := self global: assoc name: name])
                        ifTrue: [varNode]
                        ifFalse: [^ action value]] in  
EncoderForV3PlusClosures(Encoder)>>encodeVariable:sourceRange:ifUnknown:
  5: Dictionary>>at:ifAbsent:
  6: EncoderForV3PlusClosures(Encoder)>>encodeVariable:sourceRange:ifUnknown:
  7: Parser>>variable
  8: Parser>>expression
  9: Parser>>statements:innerBlock:blockNode:
10: Parser>>statements:innerBlock:
        ...Test Results:
-------------
Passed: 6399
        CollectionsTests-Arrayed (547)
        CollectionsTests-Atomic (12)
        CollectionsTests-Sequenceable (906)
        CollectionsTests-SplitJoin (27)
        CollectionsTests-Stack (16)
        CollectionsTests-Streams (37)
        CollectionsTests-Strings (596)
        CollectionsTests-Support (12)
        CollectionsTests-Unordered (1951)
        CollectionsTests-Weak (739)
        CompilerTests (179)
        FileSystem-Tests-Core (67)
        KernelTests-Chronology (583)
        KernelTests-Classes (67)
        KernelTests-Exception (2)
        KernelTests-Methods (178)
        KernelTests-Numbers (276)
        KernelTests-Objects (86)
        KernelTests-Pragmas (3)
        KernelTests-Processes (31)
        SUnit-Core-Extensions (3)
        SUnit-Core-Utilities (3)
        SUnit-Tests-Core (78)

Errors: 118
        BreadthFirstGuideTest>>#testAll
        SelectVisitorTest>>#testBreadthFirst
        SelectVisitorTest>>#testBreadthFirstSelect
        SelectVisitorTest>>#testPostorder
        SelectVisitorTest>>#testPostorderSelect
        SelectVisitorTest>>#testPreorder
        SelectVisitorTest>>#testPreorderSelect
        DeleteVisitorTest>>#testBeta
        DirectoryEntryTest>>#testCreationTimeIsADateAndTimeInstance
        DirectoryEntryTest>>#testIsDirectory
        DirectoryEntryTest>>#testIsFile
        DirectoryEntryTest>>#testIsNotDirectory
        DirectoryEntryTest>>#testIsNotFile
        DirectoryEntryTest>>#testModificationTimeIsADateAndTimeInstance
        DirectoryEntryTest>>#testReference
        DirectoryEntryTest>>#testSize
        FileLocatorTest>>#testBasename
        FileLocatorTest>>#testCPath
        FileLocatorTest>>#testCommaAddsExtension
        FileLocatorTest>>#testCommaAddsExtensionAgain
        FileLocatorTest>>#testContainsLocator
        FileLocatorTest>>#testContainsPath
        FileLocatorTest>>#testContainsReference
        FileLocatorTest>>#testFileSystem
        FileLocatorTest>>#testImageDirectory
        FileLocatorTest>>#testIsNotRoot
        FileLocatorTest>>#testIsRoot
        FileLocatorTest>>#testOriginBasename
        FileLocatorTest>>#testParent
        FileLocatorTest>>#testResolveAbsoluteReference
        FileLocatorTest>>#testResolveCompoundString
        FileLocatorTest>>#testResolvePath
        FileLocatorTest>>#testResolveRelativeReference
        FileLocatorTest>>#testResolveString
        FileLocatorTest>>#testSlash
        FileLocatorTest>>#testWithExtensionAddsExtension
        FileLocatorTest>>#testWithExtensionReplacesExtension
        PathTest>>#testContainsLocator
        PathTest>>#testIsChildOfReference
        CopyVisitorTest>>#testAll
        InteractiveResolverTest>>#testCached
        InteractiveResolverTest>>#testNew
        FileReferenceTest>>#testAllChildren
        FileReferenceTest>>#testAllDirectories
        FileReferenceTest>>#testAllEntries
        FileReferenceTest>>#testAsAbsoluteIdentity
        FileReferenceTest>>#testBaseAndExtension
        FileReferenceTest>>#testBasename
        FileReferenceTest>>#testBasenameWithoutExtension
        FileReferenceTest>>#testChildDirectories
        FileReferenceTest>>#testChildFiles
        FileReferenceTest>>#testChildOfPath
        FileReferenceTest>>#testChildOfReference
        FileReferenceTest>>#testChildren
        FileReferenceTest>>#testCommaAddsExtension
        FileReferenceTest>>#testCommaAddsExtensionAgain
        FileReferenceTest>>#testContainsLocator
        FileReferenceTest>>#testContainsPath
        FileReferenceTest>>#testContainsReference
        FileReferenceTest>>#testDeleteAll
        FileReferenceTest>>#testDeleteAllChildren
        FileReferenceTest>>#testDeleteIfAbsent
        FileReferenceTest>>#testDoesntContainLocator
        FileReferenceTest>>#testDoesntContainPath
        FileReferenceTest>>#testDoesntContainReferenceFileSystem
        FileReferenceTest>>#testDoesntContainReferencePath
        FileReferenceTest>>#testEnsureDeleted
        FileReferenceTest>>#testEntries
        FileReferenceTest>>#testExists
        FileReferenceTest>>#testGlob
        FileReferenceTest>>#testGrandchildOfReference
        FileReferenceTest>>#testHasChildren
        FileReferenceTest>>#testHasDirectories
        FileReferenceTest>>#testHasFiles
        FileReferenceTest>>#testIndicator
        FileReferenceTest>>#testIsAbsolute
        FileReferenceTest>>#testIsNotRelative
        FileReferenceTest>>#testIsNotRoot
        FileReferenceTest>>#testMakeRelative
        FileReferenceTest>>#testParent
        FileReferenceTest>>#testParentResolutionWithAbsoluteReference
        FileReferenceTest>>#testParentResolutionWithPath
        FileReferenceTest>>#testParentResolutionWithReference
        FileReferenceTest>>#testParentResolutionWithRemoteReference
        FileReferenceTest>>#testPathRelativeTo
        FileReferenceTest>>#testReadStreamDo
        FileReferenceTest>>#testReadStreamDoNotFound
        FileReferenceTest>>#testReadStreamDoifAbsent
        FileReferenceTest>>#testReadStreamDoifAbsentNot
        FileReferenceTest>>#testReadStreamIfAbsent
        FileReferenceTest>>#testRelativeToPath
        FileReferenceTest>>#testRelativeToReference
        FileReferenceTest>>#testRename
        FileReferenceTest>>#testRename
        FileReferenceTest>>#testResolve
        FileReferenceTest>>#testRootParent
        FileReferenceTest>>#testSiblingOfReference
        FileReferenceTest>>#testSimpleResolution
        FileReferenceTest>>#testSlash
        FileReferenceTest>>#testUnequalSize
        FileReferenceTest>>#testWithExtentionAddsExtension
        FileReferenceTest>>#testWithExtentionReplacesExtension
        FileReferenceTest>>#testWorkingDirectoryParent
        FileReferenceTest>>#testWriteStream
        FileReferenceTest>>#testWriteStreamDo
        FileReferenceTest>>#testWriteStreamDoExists
        FileReferenceTest>>#testWriteStreamDoifPresent
        FileReferenceTest>>#testWriteStreamDoifPresentNot
        FileReferenceTest>>#testWriteStreamifPresent
        FileReferenceTest>>#testWriteStreamifPresentExists
        CollectVisitorTest>>#testBreadthFirst
        CollectVisitorTest>>#testPostorder
        CollectVisitorTest>>#testPreorder
        PlatformResolverTest>>#testHome
        PostorderGuideTest>>#testAll
        PreorderGuideTest>>#testAll
        SystemResolverTest>>#testChanges
        SystemResolverTest>>#testImageDirectory


----------------------------------------------------------
Loaded Source:  
SLICE-Issue-5870-BUG-FileReferencegtgtrenameto-causes-DNU-GuillermoPolito.2  
from http://ss3.gemstone.com/ss/PharoInbox
Tested using Pharo-2.0-20227-a on CoInterpreter  
VMMaker-oscog-EstebanLorenzano.161 uuid:  
8e0c22c3-b48d-4d8d-a7f9-8a75dc246f28 Jul 19 2012
StackToRegisterMappingCogit VMMaker-oscog-EstebanLorenzano.161 uuid:  
8e0c22c3-b48d-4d8d-a7f9-8a75dc246f28 Jul 19 2012
https://git.gitorious.org/cogvm/blessed.git Commit:  
5151310c41b08f55b70e9c6250711cb1f3672ce7 Date: 2012-07-18 14:06:15 +0200  
By: Camillo Bruni <[hidden email]>


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5870 in pharo: [BUG] FileSystem>>rename:to: causes DNU

pharo
Updates:
        Labels: -Filesystem Target-Filesystem

Comment #12 on issue 5870 by [hidden email]: [BUG]  
FileSystem>>rename:to: causes DNU
http://code.google.com/p/pharo/issues/detail?id=5870

(No comment was entered for this change.)


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5870 in pharo: [BUG] FileSystem>>rename:to: causes DNU

pharo
Updates:
        Status: HumanReviewNeeded

Comment #13 on issue 5870 by [hidden email]: [BUG]  
FileSystem>>rename:to: causes DNU
http://code.google.com/p/pharo/issues/detail?id=5870

I think you are mistaken the parameter type... function #renameTo: is  
waiting a String, not a FileReference. And with String it works as expected  
(but I think it should throw an error.
I'm submitting a new slice who does that :)

SLICE-Issue-5870-BUG-FileSystemgtgtrenameto-causes-DNU-EstebanLorenzano.2


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5870 in pharo: [BUG] FileSystem>>rename:to: causes DNU

pharo
Updates:
        Cc: [hidden email] [hidden email]

Comment #14 on issue 5870 by [hidden email]: [BUG]  
FileSystem>>rename:to: causes DNU
http://code.google.com/p/pharo/issues/detail?id=5870

The original problem this issue was about got lost in the shuffle. Also,  
there were a few things needing tweaking in the previous fix. Here's a new  
slice in the inbox:

SLICE-Issue-5870-BUG-FileSystemgtgtrenameto-causes-DNU-SeanDeNigris.3
* Fix FileSystem>>rename:to: to send #signalFileExists: to the store, not  
to itself (which it DNU)
* Fix FileReferenceTest>>testRenameTargetExists to pass a basename to  
#renameTo:, not a full path
* Remove check for file exists in FileReference>>renameTo: (gets checked  
later anyway)
* In FileSystemStore>>rename: ifAbsent:to:ifPresent:fileSystem:, check for  
the existence of the source and destination references before trying to  
rename, not after.*

* It seems that the rename primitive behavior has changed and no longer  
returns nil when the destination exists. This is probably good, as one can  
envision a situation where you might want to overwrite a file (this is the  
behavior of Unix's mv)


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5870 in pharo: [BUG] FileSystem>>rename:to: causes DNU

pharo
Updates:
        Status: FixToInclude

Comment #15 on issue 5870 by [hidden email]: [BUG]  
FileSystem>>rename:to: causes DNU
http://code.google.com/p/pharo/issues/detail?id=5870

(No comment was entered for this change.)


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5870 in pharo: [BUG] FileSystem>>rename:to: causes DNU

pharo
Updates:
        Status: Integrated

Comment #16 on issue 5870 by [hidden email]: [BUG]  
FileSystem>>rename:to: causes DNU
http://code.google.com/p/pharo/issues/detail?id=5870

in 20258


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker