diff --git a/docs/manual/CoreTasks/exec.html b/docs/manual/CoreTasks/exec.html index 385b5aec5..50f97f8eb 100644 --- a/docs/manual/CoreTasks/exec.html +++ b/docs/manual/CoreTasks/exec.html @@ -20,20 +20,27 @@ Windows executable and is not aware of Cygwin conventions.
The command specified using executable
and
<arg>
elements is executed exactly as specified
-inside a temporary DCL script. This means that paths have to be
-written in VMS style. It is also required that the logical
-JAVA$FORK_SUPPORT_CHDIR
is set to TRUE
(see
-the JDK Release Notes).
executable
points to a DCL script remember to
+prefix it with an @
-sign
+(e.g. executable="@[FOO]BAR.COM"
), just as you would in a
+DCL script<exec>
to work in an environment with a Java VM
+older than version 1.4.1-2 it is also required that the logical
+JAVA$FORK_SUPPORT_CHDIR
is set to TRUE
in
+the job table (see the JDK Release Notes).
+
Please note that the Java VM provided by HP doesn't follow OpenVMS'
conventions of exit codes. If you run a Java VM with this task, the
task may falsely claim that an error occured (or silently ignore an
error). Don't use this task to run JAVA.EXE
, use a
<java>
task with the fork
attribute
-set ti true
instead as this task will follow the VM's
+set to true
instead as this task will follow the VM's
interpretation of exit codes.
File#getCanonicalPath()
it specifically doesn't
+ * resolve symbolic links.
*
* @param path the path to be normalized
* @return the normalized version of the path.
@@ -937,6 +939,65 @@ public class FileUtils {
return new File(path);
}
+ /**
+ * Returns a VMS String representation of a File
object.
+ * This is useful since the JVM by default internally converts VMS paths
+ * to Unix style.
+ * The returned String is always an absolute path.
+ *
+ * @param f The File
to get the VMS path for.
+ * @return The absolute VMS path to f
.
+ */
+ public String toVMSPath(File f) {
+ // format: "DEVICE:[DIR.SUBDIR]FILE"
+ String osPath;
+ String path = normalize(f.getAbsolutePath()).getPath();
+ String name = f.getName();
+ boolean isAbsolute = path.charAt(0) == File.separatorChar;
+ // treat directories specified using .DIR syntax as files
+ boolean isDirectory = f.isDirectory() &&
+ !name.regionMatches(true, name.length() - 4, ".DIR", 0, 4);
+
+ String device = null;
+ StringBuffer directory = null;
+ String file = null;
+
+ int index = 0;
+
+ if (isAbsolute) {
+ index = path.indexOf(File.separatorChar, 1);
+ if (index == -1) {
+ return path.substring(1) + ":[000000]";
+ } else {
+ device = path.substring(1, index++);
+ }
+ }
+ if (isDirectory) {
+ directory = new StringBuffer(path.substring(index).
+ replace(File.separatorChar, '.'));
+ } else {
+ int dirEnd =
+ path.lastIndexOf(File.separatorChar, path.length());
+ if (dirEnd == -1 || dirEnd < index) {
+ file = path.substring(index);
+ } else {
+ directory = new StringBuffer(path.substring(index, dirEnd).
+ replace(File.separatorChar, '.'));
+ index = dirEnd + 1;
+ if (path.length() > index) {
+ file = path.substring(index);
+ }
+ }
+ }
+ if (!isAbsolute && directory != null) {
+ directory.insert(0, '.');
+ }
+ osPath = ((device != null) ? device + ":" : "") +
+ ((directory != null) ? "[" + directory + "]" : "") +
+ ((file != null) ? file : "");
+ return osPath;
+ }
+
/**
* Create a temporary file in a given directory.
*