[Gambas-user] UnCompress question
benoit.minisini at gambas-basic.org
Mon Sep 12 11:54:53 CEST 2022
Le 12/09/2022 à 11:37, Bruce Steers a écrit :
> On Sun, 11 Sept 2022 at 15:35, Bruce Steers <bsteers4 at gmail.com
> <mailto:bsteers4 at gmail.com>> wrote:
> On Sat, 10 Sept 2022 at 15:12, Benoit Minisini
> <benoit.minisini at gambas-basic.org
> <mailto:benoit.minisini at gambas-basic.org>> wrote:
> Le 10/09/2022 à 14:25, Bruce Steers a écrit :
> > Yes. 'gb.compress' is for compressing, not archiving.
> > If you want to create compressed archives, use the
> command-line tools.
> > Regards,
> > --
> > Benoît Minisini.
> > Ahh , very well
> > I see there's /main/gbc/gbc_archive.c but it looks
> internal/private is
> > there too much to do to update Uncompress to support listing and
> > extracting items or can gbc_archive be modified to extract
> items and
> > work publicly?
> > I assume gambas itself (gbc) can unarchive because a gambas
> exe is an
> > archive (or am i wrong about that and it works differently?)
> > Note: not interested in adding/making archives just extracting.
> > Reason: I'm adding an update class to my progs that uses gitlab,
> > It checks version in .project file and downloads the archive
> if newer,
> > then extracts contents to update/compile source.
> > Respects
> > BruceS
> I really don't see the problem with using SHELL or EXEC with 'zip',
> 'tar', and so on.
> aah fair enough. Shell or Exec it is then :)
> Maybe we (i could have a go) could expand Shell in gb.util a bit to be
> more than MkDir, RmDir, Move?
> (btw. i am considering Shell.class to be where we would put some
> functions that are just for Shell/Exec use)
> Things i think (have previously thought) would be useful Shell commands
> for everyone to have in gambas...
> Shell.ArchiveList(ArchivePath) As String ' could auto-handle various
> Shell.ArchiveExtract(ArchivePath, DestFolder, Optional FileList As String)
> Shell.ArchiveAdd(ArchivePath, FileList As String)
> Shell.PackageInstall(PkgName) ' basic installer that will handle most
> installers and be fine for simple package names, returning error code if
> Eg. Shell.PackageInstall("git")
> Some multi-platform compatible functions like this
> just some food for thought :)
Not in 'gb.util', which cannot depend on any external library, and
should not depend on external tools. 'gb.util' is only for adding less
common small functions and features to the language.
A common interface to the underlying various archive tools should have
its own component.
Installing package is something entirely system et distribution
specific, so it should have its own component too.
Moreover, this feature seems to have already been standardized with
'PackageKit', so maybe one should look at it first.
More information about the User