(GarOperation): fixed path creation.

This commit is contained in:
morkt
2017-02-05 01:38:54 +04:00
parent f486f19495
commit 5e6c8e4048
2 changed files with 13 additions and 8 deletions

View File

@@ -45,8 +45,15 @@ namespace GARbro.GUI
m_title = dialog_title;
}
protected Stream CreateNewFile (string filename)
/// <summary>
/// Create file <paramref name="filename"/>. Also create path to file if <paramref name="create_path"/> is true.
/// If file aready exists, popup dialog asking for necessary action.
/// WARNING: path to file should be relative, ArchiveFormat.CreatePath strips drive/root specification.
/// </summary>
protected Stream CreateNewFile (string filename, bool create_path = false)
{
if (create_path)
filename = GameRes.ArchiveFormat.CreatePath (filename);
FileMode open_mode = FileMode.CreateNew;
if (m_duplicate_action.ApplyToAll &&
m_duplicate_action.Action == ExistingFileAction.Overwrite)