Skip to content

Unable to set destination to nonexistent directory #4

@IlyaPlotkin-azur

Description

@IlyaPlotkin-azur

Simply put if I do following:

var sourceFilePath = "path_to_previously_downloaded_file"; //file does exist!
var destinationPath = "path_to_directory_somethere_in_Application.persistentDataPath"; //directory may exist from previous unzip

if (Directory.Exists(destinationPath))
{
Directory.Delete(destinationPath, true);
}

//unpack archive file
Archiver.Decompress(sourceFilePath, destinationPath);

I then get
FileNotFoundException: Could not find file "destinationPath" System.IO.File.GetAttributes (System.String path) (at <437ba245d8404784b9fbab9b439ac908>:0) LightBuzz.Archiver.Archiver.Decompress (System.String source, System.String destination) (at <23f315dad29243e0bbe798bc41113127>:0)

Currently I'm circumventing it by Directory.CreateDirectory(destinationPath); before Decompress, but according to logic in Decompress method it should create 'destination' directory in case it does not exist.
I suppose it's because you can't do File.GetAttributes on non-existent path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions