RE: tempFile & shell component
Andreas Unterkircher <[email protected]>
| Newsgroups | gmane.comp.java.smartfrog.user |
|---|---|
| Message-ID | <[email protected]> |
Hello Julio,
thank you for the hint. Unfortunately it still doesn't work: according to
your advice I try the following
#include "org/smartfrog/components.sf"
#include "org/smartfrog/services/utils/concat/components.sf"
#include "org/smartfrog/services/filesystem/components.sf"
#include "org/smartfrog/services/os/runshell/components.sf"
sfConfig extends Compound {
testFile extends TempFileWithCleanup {
dir "/tmp";
prefix "tempfile.txt";
text "foo";
}
testCmd extends BashShellScript {
processName "test";
string1 extends LazyConcat {
string extends LAZY {
a "ls ";
b LAZY testFile:filename;
}
}
cmd LAZY string1:concat;
}
}
But this gives:
2005/06/28 14:40:19:274 CEST [DEBUG][RMI TCP Connection(2)-137.138.38.90]
HOST oplabox03.cern.ch:rootProcess:test1 - creating temp file in dir
[/tmp] prefix=tempfile.txt suffix=null
[defaultRunShell(bash)] LOG > Reference not found, SFRunShell, 2
I think the problem stems from "cmd LAZY string1:concat".
Best regards,
Andreas
On Tue, 28 Jun 2005, Guijarro, Julio wrote:
> Hi Andreas,
>
> The "Concat" has to happen at runtime because the filename does not
> exist until then. For that you need to use a component that offers
> similar functionality: LazyConcat. Lazy concat will create a runtime
> attribute called "concat" that will have the concatenation of all the
> attributes contained inside its "string" attribute.
>
>
> Try
> #include "org/smartfrog/services/utils/concat/components.sf"
>
> > testCmd extends BashShellScript {
> > processName "test";
> string1 extends LazyConcat {
> string extends LAZY {
> a "dir ";
> b LAZY testFile:filename;
> }
> }
> cmd LAZY string1:concat;
> }
>
> Julio
>
> > -----Original Message-----
> > From: smartfrog-support-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org [mailto:smartfrog-
> > [email protected]] On Behalf Of Andreas Unterkircher
> > Sent: 27 June 2005 16:30
> > To: smartfrog-support-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> > Subject: [Smartfrog-support] tempFile & shell component
> >
> >
> > Hello,
> >
> > I would like to use the TempFileWithCleanup component in conjunction
> with
> > a BashShellScript component. E.g. something like:
> >
> > sfConfig extends Compound {
> >
> > testFile extends TempFileWithCleanup {
> > dir "/tmp";
> > prefix "tempFile.txt";
> > text "foo";
> > }
> >
> > testCmd extends BashShellScript {
> > processName "test";
> > string1 LAZY ATTRIB testFile:filename;
> > cmd extends concat {
> > a "ls -l";
> > b string1
> > }
> > }
> >
> > The should list the temporary file (wich gets created in the sfDeploy
> > phase of the TempFileWithCleanup component). The above example doesn't
> > work; I played around a little bit but I could not figure out how to
> > access the "filename" field so that I can use with the shell
> component.
> > How one could do that ?
> >
> > Thanks,
> > Andreas
> >
> >
> > -------------------------------------------------------
> > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> > from IBM. Find simple to follow Roadmaps, straightforward articles,
> > informative Webcasts and more! Get everything you need to get up to
> > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> > _______________________________________________
> > Smartfrog-support mailing list
> > Smartfrog-support-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> > https://lists.sourceforge.net/lists/listinfo/smartfrog-support
>
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click