|
From: <ha...@us...> - 2007-09-07 00:52:28
|
Revision: 1734
http://cogkit.svn.sourceforge.net/cogkit/?rev=1734&view=rev
Author: hategan
Date: 2007-09-06 17:52:18 -0700 (Thu, 06 Sep 2007)
Log Message:
-----------
same for file:read
Modified Paths:
--------------
trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/workflow/nodes/functions/Misc.java
Modified: trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/workflow/nodes/functions/Misc.java
===================================================================
--- trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/workflow/nodes/functions/Misc.java 2007-09-06 22:16:54 UTC (rev 1733)
+++ trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/workflow/nodes/functions/Misc.java 2007-09-07 00:52:18 UTC (rev 1734)
@@ -112,15 +112,19 @@
public Object sys_readfile(VariableStack stack) throws ExecutionException {
try {
- BufferedReader br = new BufferedReader(new FileReader(new File(
- TypeUtil.toString(PA_FILE.getValue(stack)))));
+ File f = new File(TypeUtil.toString(PA_FILE.getValue(stack)));
+ if (!f.isAbsolute()) {
+ f = new File(stack.getExecutionContext().getCwd() + File.separator + f.getPath());
+ }
+ BufferedReader br = new BufferedReader(new FileReader(f));
StringBuffer text = new StringBuffer();
String line = br.readLine();
while (line != null) {
text.append(line);
text.append('\n');
line = br.readLine();
- };
+ }
+ ;
return text.toString();
}
catch (Exception e) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|