also, That OSProcess code looks really nice.
cudos and thanks.
tty
---- On Tue, 11 Jul 2023 16:19:13 -0400 gettimothy via Squeak-dev squeak-dev@lists.squeakfoundation.org wrote ---
Here is a failed naive attempt. The Unix Proc wants a standard filestream, not a squeaky ReadWriteStream...
| filename in ios path|
path := '/home/wm/usr/src/smalltalk/XML/'.
filename := 'bookstore.xml'.
in := OSProcess readOnlyFileNamed: path, filename.
ios := ReadWriteStream on:''.
proc := UnixProcess
forkJob: '/bin/bzcat'
arguments: nil
environment: nil
descriptors: (Array with: in with: ios with: nil). <--this does not work.
ios printOn: Transcript.
in close.
Tomorrow, I will try a FileStream on the designated Stdout ...but that seems hokey.
I really want to get the output from bzcat directly into Squeak.
ideas appreciated.
cordially,
t
---- On Mon, 10 Jul 2023 18:00:53 -0400 Eliot Miranda mailto:eliot.miranda@gmail.com wrote ---
Hi,
yes, it should be doable with David Lewis’s OSProcess package.
_,,,^..^,,,_ (phone)
On Jul 10, 2023, at 12:03 PM, gettimothy via Squeak-dev mailto:squeak-dev@lists.squeakfoundation.org wrote:
Hi Folks.
I have a 21Gb bzip file I would rather not decompress as disk space is at a semi-premium.
the bzcat command allows me to "extract" the contents to stoud
bzcat humungousfile.bz2 | less
gives me the output I want to process
For running XMLSax on a file, I have some existing code to use...
|ios|
ios := (FileStream readOnlyFileNamed:('/your/path/to/the/big/xml/file.xml')).
[(DocDemoSaxHandler on: ios) pingevery:100000; optimizeForLargeDocuments;parseDocument] timeProfile .
What I would like to do is have, from within Squeak access to that bzcat output via some sort of ReadStream.
Doable?
thx in advance.
tty