in reply to Re^5: IO::Uncompress::Gunzip thread safe?
in thread IO::Uncompress::Gunzip thread safe?

I suppose it could work if we had the gzip command on our Windows servers. What provides the gzip command on Windows for you? Security restricts what we can install, but it is worth looking into.

Also, I noticed that providing the command arguments to open in as a list rather than a single string doesn't work in Windows? Any suggestions for preventing unusual file name characters from causing problems on Linux and Windows?

  • Comment on Re^6: IO::Uncompress::Gunzip thread safe?

Replies are listed 'Best First'.
Re^7: IO::Uncompress::Gunzip thread safe?
by BrowserUk (Patriarch) on Nov 22, 2016 at 15:42 UTC
    I suppose it could work if we had the gzip command on our Windows servers. What provides the gzip command on Windows for you? Security restricts what we can install, but it is worth looking into.

    As the problem you're having with IO::Uncompress::GZip is thread related, there is nothing to stop you creating your own "gzip" command that supports just enough to satisfy your needs.

    Also, I noticed that providing the command arguments to open in as a list rather than a single string doesn't work in Windows?

    Hm Perldoc says: " On Windows, only the system PROGRAM LIST syntax will reliably avoid using the shell; system LIST , even with more than one element, will fall back to the shell if the first spawn fails.". So, as long as you put the command name as the first argument, the rest of the list will be passed as on *nix.

    Any suggestions for preventing unusual file name characters from causing problems on Linux and Windows?
    Personally, I avoid the problem by not using "unusual characters" for filenames; and rejecting them in filenames entered from external sources. Anything else just creates knock on problems for every process that needs to find and use those filenames in down stream. Why bother.

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re^7: IO::Uncompress::Gunzip thread safe?
by soonix (Chancellor) on Nov 22, 2016 at 19:04 UTC
    7zip can create gzip compatible archives. Another possibility is Git Extensions (GUI for git), which includes several Unixish command line tools incluging gzip.

    Both are open source, so even a code review would be possible.

    As for executing, BrowserUk is right - e.g.
    my @cmd = ( 'c:\Program Files\7-Zip\7z.exe', 'a', '-mx9', '-r', 'alltexts.zip', '*.txt', ); system @cmd;
    would work
Re^7: IO::Uncompress::Gunzip thread safe?
by afoken (Chancellor) on Nov 22, 2016 at 21:30 UTC
    What provides the gzip command on Windows for you?

    UnxUtils (yes, it's a little bit old), maybe Cygwin

    Security restricts what we can install

    UnxUtils does not require any installation, just unpack the binaries from the ZIP archive.

    Strawberry comes with a quite complete build environment, so maybe you could compile gzip from source.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

      UnxUtils (yes, it's a little bit old), maybe Cygwin

      or, similarly, the GnuWin32 gzip, which has an installer available, but you can download the binaries or the sources separately, as well. (Versions: UnxUtils gzip is v1.2.4; GnuWin32 gzip is v1.3.12. Both rather ancient.)