[kepler-dev] File exists? actor

Christopher Brooks cxh at eecs.berkeley.edu
Mon Apr 24 17:36:05 PDT 2006


Hi Norbert,
Right, DirectoryListing throws an exception if the file cannot be found:

ptolemy.kernel.util.IllegalActionException: Cannot read file
'c:/cxh/ptII/ptolemy/actor/lib/io/test/auto/foo'
  in .<Unnamed Object>.DirectoryListing.directoryOrURL
Because:
Cannot read file 'c:/cxh/ptII/ptolemy/actor/lib/io/test/auto/foo' or
'c:/cxh/ptII/ptolemy/actor/lib/io/test/auto/foo'

You would need to run DirectoryListing in the parent of directory and
do some processing.  This sounds gross.

I'm not sure what FileExists is.  There is findFile, which 
can be used in the expression language.

The docs for findFile are at:
http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII5.0/ptII5.0/doc/codeDoc/ptolemy/data/expr/UtilityFunctions.html

You sometimes see the Expression have a parameter set to
   eval(readFile(findFile("foo"))), 
See
ptII/ptolemy/domains/rtp/kernel/test/auto/simpleTest.xml
or
ptII/ptolemy/domains/tm/test/auto/FFTTest.xml

_Christopher
--------

    
    Hi,
    directory listing throws an exception if the directory does not exist.
    I need just a true or false so I can branch in the worfklow.
    
    Ilkay,
    The FileExist expression: I've never heard about this. I know only about 
    the String methods. How can I use this?
    
    Thanks
    Norbert
    
    On Mon, 24 Apr 2006, Ilkay Altintas wrote:
    
    > There is a directory listing actor that you can do some processing on the
    
    > outputs.
    >
    > You can also use the Expression actor with the FileExists expression.
    >
    > HTH,
    > -ilkay
    >
    _______________________________________________
    Kepler-dev mailing list
    Kepler-dev at ecoinformatics.org
    http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-dev
--------


More information about the Kepler-dev mailing list