C1 Community
ComponentOne Community is a free source for developers and help authors to collaborate and communicate.
Sign in
|
Join
|
Help
Home
Blogs
Forums
Wikis
Forums
»
Windows Mobile
»
Zip for Mobile Devices
»
Extracting relative paths
Extracting relative paths
rated by 0 users
This post has 2 Replies | 0 Followers
Posts
89,785
Reply
newsgroup_archive
Posted: Thu, Oct 20 2005 8:50 AM
rated by 0 users
Am I just missing something or can't the C1 Mobile Zip create the relative paths when extracting files? It slows down processing to have to check and create the directories before extracting the files. Thanks.
Click here to view the original newsgroup article
(read only).
Posts
89,785
Reply
newsgroup_archive
replied on
Mon, Nov 7 2005 11:28 AM
rated by 0 users
> Am I just missing something or can't the C1 Mobile Zip create the relative
> paths when extracting files? It slows down processing to have to check and
> create the directories before extracting the files. Thanks.
It really can't do that (at least not the current version).
But it would probably take the same amount of time for the component to do
it as it would for your app, so it seems like an ease-of-use/convenience
issue, not really performance related.
Click here to view the original newsgroup article
(read only).
Posts
89,785
Reply
newsgroup_archive
replied on
Mon, Nov 7 2005 6:40 PM
rated by 0 users
> It really can't do that (at least not the current version).
BTW, here's some code that does it in WinForms. I haven't tested this in the
compact framework, but it might worke there as well:
private void ExtractFolder(C1ZipFile zip, string path)
{
foreach (C1ZipEntry ze in zip.Entries)
{
string fn = ze.FileName;
string filePath = Path.Combine(path, Path.GetDirectoryName(fn));
string fileName = Path.GetFileName(fn);
if (!Directory.Exists(filePath))
{
Directory.CreateDirectory(filePath);
}
zip.Entries.Extract(ze.FileName, Path.Combine(filePath, fileName));
}
}
Click here to view the original newsgroup article
(read only).
Previous
|
Next
Page 1 of 1 (3 items) |
RSS
Contact ComponentOne: 1.800.858.2739 ©1987-2010 ComponentOne LLC All Rights Reserved.