Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mata: confusing error message

    when you type:
    . mata: rmdir ("vendor")

    you get:
    could not create directory vendor
    rmdir(): 693 could not remove directory
    <istmt>: - function returned error

    The error seems to be an extra errprintf in rmdir.mata


    *! version 1.0.0 15dec2004
    version 9.0

    mata:

    void rmdir(string scalar dirpath)
    {
    if (_rmdir(dirpath)) {
    errprintf("could not create directory %s\n", dirpath)
    _error(693, "could not remove directory")
    /*NOTREACHED*/
    }
    }

    end

  • #2
    That seems like a bug, try contacting technical support: [email protected]

    Comment


    • #3
      Salah Mahmud and Sergio Correia :

      I'm not sure it's a bug. When I do:

      Code:
      clear all
      mata:
          mkdir("foo")
          rmdir("foo")
      end
      There are no errors. However, when I do the following:

      Code:
      mata:
          mkdir("foo")
          chdir("foo")
          U = runiform(10,10) 
          mata matsave U U
          rmdir("foo")
      end
      I find that the rmdir("foo") command throws the same error as described by Salah Mahmud. You will notice that in the second example I am trying to remove a nonempty directory, which is what causes the error. The help file says that rmdir() can only be used to remove empty directories! Is that possibly the problem?

      Hope that helps!

      Matthew J. Baker

      Comment


      • #4
        @Matthew J. Baker
        the bug is that the error says could not create directory. naturally, you will see the misleading error message only if _rmdir fails.

        Comment

        Working...
        X