d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Programming General
Prev123456Next
Add Reply New Topic New Poll
Member
Posts: 3,197
Joined: May 4 2013
Gold: 1,457.00
May 16 2017 04:54am
libarchive?
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
May 16 2017 07:34am
Quote (nuvo @ May 16 2017 06:54am)
libarchive?


Hmm I'll take a look.

I need this to be an independent library as I need to port it to a arm platform that doesn't run a full version of Linux.
Member
Posts: 3,197
Joined: May 4 2013
Gold: 1,457.00
May 16 2017 07:42am
Well then I'm pretty sure it needs proper operating system, for filesystem access, mutexes, malloc and whatnot. Most libraries will make some assumptions
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
May 16 2017 10:35am
Quote (nuvo @ May 16 2017 09:42am)
Well then I'm pretty sure it needs proper operating system, for filesystem access, mutexes, malloc and whatnot. Most libraries will make some assumptions


Yea I need something that can work only from memory.

The platform exposes a SDK which gives you access to the fs and stuff but it doesn't you the regular syscall names. I would have to load the files into memory before hand then apply the archive library to them.
Member
Posts: 3,197
Joined: May 4 2013
Gold: 1,457.00
May 16 2017 12:00pm
If you need to kinda "preload" the files, can't you stick to one format to make it at least somewhat manageable? Then i'd probably just reimplement gzip as the simplest one (or maybe even evaluate if libz can be used?) Or maybe try one of the algorithms in busybox, code seems to be simple: https://github.com/mirror/busybox/tree/7fa799a97d381902ab27556918722a6e2d138b9e/archival


Note that if you're constrained in memory or cpu department, lzma or simillar may be completely unusable too

This post was edited by nuvo on May 16 2017 12:05pm
Member
Posts: 36,123
Joined: Jul 18 2008
Gold: 2,407.00
May 19 2017 08:19am
Quote (AbDuCt @ May 16 2017 11:35am)
Yea I need something that can work only from memory.

The platform exposes a SDK which gives you access to the fs and stuff but it doesn't you the regular syscall names. I would have to load the files into memory before hand then apply the archive library to them.


Dealing with compressed files in memory seems like it kind of defeats the purpose of compressing files in the first place.
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
May 19 2017 09:27am
Quote (Mastersam93 @ May 19 2017 10:19am)
Dealing with compressed files in memory seems like it kind of defeats the purpose of compressing files in the first place.


How so?

You do realize windows compresses its own memory in memory.
Member
Posts: 36,123
Joined: Jul 18 2008
Gold: 2,407.00
May 19 2017 10:24am
Quote (AbDuCt @ May 19 2017 10:27am)
How so?

You do realize windows compresses its own memory in memory.



That just blew my mind.

But 9 times out of 10 compressing files is just to save disk space or bandwidth. If you need work with the contents of a directory is there a reason you can just decompress it entirely first?
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
May 19 2017 10:37am
Quote (Mastersam93 @ May 19 2017 12:24pm)
That just blew my mind.

But 9 times out of 10 compressing files is just to save disk space or bandwidth. If you need work with the contents of a directory is there a reason you can just decompress it entirely first?


Directory size is one issue.

The reason for the memory constraint is because any library that handles loading of files itself will not work on the system. I would either have to load the entire archive into memory or some how wrap their loading calls around the systems sdk.

That's why I either want to manipulate the way the library reads the file so I can use the sdk read calls, or read the entire glob into memory which the library can do what ever it pleases with it.

Then again loading an entire file into memory may not be the best solution either.

Plus archives isn't only about compression.

Archiving is a way to store many files in a container. Compression is an after effect that most containers (except like tar) apply because it makes sense to do so.

Edit:: Anyways I decided to take a different approach. I'm going to make a web frontend that the application on the system can work with. This offloads the entire archive problem, memory, and file size problems to a remote standardized server while still having the functionality on the device.

This post was edited by AbDuCt on May 19 2017 10:44am
Member
Posts: 36,123
Joined: Jul 18 2008
Gold: 2,407.00
May 20 2017 05:43am
Quote (AbDuCt @ May 19 2017 11:37am)
Directory size is one issue.

The reason for the memory constraint is because any library that handles loading of files itself will not work on the system. I would either have to load the entire archive into memory or some how wrap their loading calls around the systems sdk.

That's why I either want to manipulate the way the library reads the file so I can use the sdk read calls, or read the entire glob into memory which the library can do what ever it pleases with it.

Then again loading an entire file into memory may not be the best solution either.

Plus archives isn't only about compression.

Archiving is a way to store many files in a container. Compression is an after effect that most containers (except like tar) apply because it makes sense to do so.

Edit:: Anyways I decided to take a different approach. I'm going to make a web frontend that the application on the system can work with. This offloads the entire archive problem, memory, and file size problems to a remote standardized server while still having the functionality on the device.



What's the device?
Go Back To Programming & Development Topic List
Prev123456Next
Add Reply New Topic New Poll