How can i get the full directory path for a file located in isolated storage on a windows phone 8 application I am unzipping a zip file to a specific folder to my isolated storage and i am using Sharpzip library for doing this , The sharpzip library returns a filename as name=folder/subfolder/subfolder2/filename.txt and my root folder is root_folder="/Application/Files/"; So i want to save the file as "/Application/Files/folder/subfolder/subfolder2/filename.txt" So for doing this first i have to create the parent directory for filename.txt in the isolated storage. So how can i know the name of Directory ? In windows application I use
String fullZipToPath = System.IO.Path.Combine(root_folder,name);
FileInfo fInfo = new FileInfo(fullZipToPath);
if (!fInfo.Directory.Exists)
{
string directory = fInfo.Directory.Name;
Directory.CreateDirectory(fInfo.Directory.FullName);
}
In case of Phone app fileInfo is not returning the exact Directory name (Since it considers path based on emulator location). What is the best way to get the Directory name of the file like if file_name=folder/subfolder/subfolder2/filename.txt ,i want directory_name = folder/subfolder/subfolder2/ Now i am using some string manipulations like split on the basis of '/' and extract the path .Is there any other direct methods?