Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set destination to nonexistent directory #4

Open
IlyaPlotkin-azur opened this issue Jul 7, 2020 · 1 comment
Open

Unable to set destination to nonexistent directory #4

IlyaPlotkin-azur opened this issue Jul 7, 2020 · 1 comment

Comments

@IlyaPlotkin-azur
Copy link

IlyaPlotkin-azur commented Jul 7, 2020

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.

@Vangos
Copy link
Member

Vangos commented Jul 8, 2020

You are right. As a design decision, we've left that part to the developer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants