[Glass] Execution a simple "cp command ...

itlists@schrievkrom.de via Glass glass at lists.gemtalksystems.com
Thu Jun 11 12:12:38 PDT 2015


... seems to e pretty difficult ...

I tried stuff like:

GsHostProcess>>mskCopyFile: source to: target
	| aGsHostProcess output aWriteStream  |

	aWriteStream := WriteStream on: String new.
	aWriteStream
		nextPutAll: '/bin/bash -c ' ;
		nextPut: $' ;
		nextPutAll: 'cp ' ;
		nextPut: $" ;
		nextPutAll: source asString ;
		nextPut: $" ;
		space ;
		nextPut: $" ;
		nextPutAll: target asString ;
		nextPut: $" ;
		nextPut: $' .

	Transcript cr ; show: aWriteStream contents.

	aGsHostProcess := GsHostProcess fork: aWriteStream contents.
        ....

When executing stuff like

  GsHostProcess
    mskCopyFile:  '/var/www/fileswebcati/customers/test.txt'
    to:  '/var/www/fileswebcati/customers/test2.txt'

the following command is printed on the Transcript:

/bin/bash -c 'cp "/var/www/fileswebcati/customers/test.txt"
"/var/www/fileswebcati/customers/test2.txt"'

executing it in a real shell: everything is ok.

So: anyone telling me, how a simple "cp"  can be executed under Gemstone ...


Marten


-- 
Marten Feldtmann


More information about the Glass mailing list