Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-16556

check_dir_exists() recursive does not work on windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 1.8.7, 1.9.3
    • 1.8.6, 1.9.2
    • Libraries
    • None
    • Windows XP Pro V3 with NTFS file system
    • MOODLE_18_STABLE, MOODLE_19_STABLE
    • MOODLE_18_STABLE, MOODLE_19_STABLE

      We recently ran into a problem with check_dir_exists() and having it recursively create directories on Windows. Example call:

      $CFG->dataroot = 'C:\xampp/moodledata';
      check_dir_exists('C:\xampp/moodledata/path/to/dir', true, true);

      What is passed to mkdir:

      C:\xampp/moodledata/C:/
      C:\xampp/moodledata/C:/xampp/
      C:\xampp/moodledata/C:/xampp/moodledata/
      C:\xampp/moodledata/C:/xampp/moodledata/path/
      C:\xampp/moodledata/C:/xampp/moodledata/path/to/
      C:\xampp/moodledata/C:/xampp/moodledata/path/to/dir/

      Now, same call with the attached patch:

      C:\xampp/moodledata/path/
      C:\xampp/moodledata/path/to/
      C:\xampp/moodledata/path/to/dir/

      Since this method is called everywhere, I don't see how this problem hasn't come up before, which leads me to believe that I'm missing something. I did not experience the problem first hand as I develop on a Mac but as you can see from my simple test above, it is not working as intended.

            nicolasconnault Nicolas Connault
            bushido Mark Nielsen
            Petr Skoda Petr Skoda
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.