Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a valid and existent workspace (file geodatabase) in a specific folder.

    [TestMethod]
    public void WorkspaceHandler_TestConstructor_FileGdbWorkspace()
    {
        workHandler = new WorkspaceHandler(gdbWorkspace);

        IWorkspace workspace = workHandler.GetCurrentWorkspace;

        Assert.AreEqual(gdbWorkspace, workspace.PathName);
        Assert.AreEqual(esriWorkspaceType.esriLocalDatabaseWorkspace, workspace.Type);
        Assert.AreEqual(false, workspace.IsDirectory());
        Assert.AreEqual(true, workspace.Exists());
    }

My last assert fails. All the other ones are working OK. Is there any sort of specificity on this particular method?

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

I'm able to reproduce this with 9.3.1 - I'd call it a bug. I never use this method. Instead, I use IWorkspaceFactory.IsWorkspace. The help doc says IWorkspace.Exists is there so you can detect if the underlying files for a workspace have been deleted by another app. I'd bet IsWorkspace can do this too, but I'd check.

share|improve this answer
    
Thanks for the info Kirk. All uses os Exists() fails. This on 9.3.1 too. Should I call ESRI? :P –  George Jul 27 '10 at 14:37
    
Shapefile workspaces return true for Exists() for me. ESRI's gotten a lot more responsive about bugs lately, you might give it a try. (If you can reproduce on 10.0 I bet they'd be more responsive though). –  Kirk Kuykendall Jul 27 '10 at 16:21
add comment

This is a bug which was fixed in ArcGIS 10.0.

share|improve this answer
    
thanks for the help :P. saved me some trouble. –  George Jul 31 '10 at 20:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.