Join
Sign in
ComponentOne Community
Search Options
Search Everything
Search Windows Mobile
Home
WinForms
WPF
ASP.NET
Silverlight
SharePoint
Help Authoring
ActiveX
Windows Mobile
General
Visual Studio Extensions
Legacy
Marketing Blogs
Dev Tools
Evangelists
C1Announcements
More ...
Home
»
Windows Mobile
»
Zip for Mobile Devices
»
Extracting relative paths
Re: Extracting relative paths
Windows Mobile
.NET Compact Framework controls
Get this RSS feed
Home
Forums
Files
Wiki
Details
2
Replies
0
Subscribers
1779
days old
Options
Subscribe via RSS
Send to friend
Zip for Mobile Devices
Extracting relative paths
rated by 0 users
This post has
2 Replies |
0
Followers
Posted by
newsgroup_archive
on
10-20-2005 8:50 AM
rated by 0 users
Extracting relative paths
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).
Posted by
newsgroup_archive
on
11-7-2005 11:28 AM
rated by 0 users
Re: Extracting relative paths
> 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).
Posted by
newsgroup_archive
on
11-7-2005 6:40 PM
rated by 0 users
Re: Extracting relative paths
> 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).
Page 1 of 1 (3 items)