+ /* copy optional folders, if any */
+
+ string old = plugins_dir ();
+ if (Glib::file_test (old, Glib::FILE_TEST_EXISTS)) {
+ string newdir = Glib::build_filename (to_dir, Glib::path_get_basename (old));
+ copy_files (old, newdir);
+ }
+
+ old = externals_dir ();
+ if (Glib::file_test (old, Glib::FILE_TEST_EXISTS)) {
+ string newdir = Glib::build_filename (to_dir, Glib::path_get_basename (old));
+ copy_files (old, newdir);
+ }
+
+ old = automation_dir ();
+ if (Glib::file_test (old, Glib::FILE_TEST_EXISTS)) {
+ string newdir = Glib::build_filename (to_dir, Glib::path_get_basename (old));
+ copy_files (old, newdir);
+ }
+
+ if (saveas.include_media) {
+
+ if (saveas.copy_media) {
+#ifndef PLATFORM_WINDOWS
+ /* There are problems with analysis files on
+ * Windows, because they used a colon in their
+ * names as late as 4.0. Colons are not legal
+ * under Windows even if NTFS allows them.
+ *
+ * This is a tricky problem to solve so for
+ * just don't copy these files. They will be
+ * regenerated as-needed anyway, subject to the
+ * existing issue that the filenames will be
+ * rejected by Windows, which is a separate
+ * problem (though related).
+ */
+
+ /* only needed if we are copying media, since the
+ * analysis data refers to media data
+ */
+
+ old = analysis_dir ();
+ if (Glib::file_test (old, Glib::FILE_TEST_EXISTS)) {
+ string newdir = Glib::build_filename (to_dir, "analysis");
+ copy_files (old, newdir);
+ }
+#endif /* PLATFORM_WINDOWS */
+ }
+ }
+
+