- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Java: Runtime#exec lsedit "/tmp/file/path" fai...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2009 08:33 AM
тАО11-25-2009 08:33 AM
I'm working on SVNKit -- pure Java SVN implementation.
Some time ago we got a bug report always reproducible on OpenVMS alpha server, you can find it at http://svnkit.com/tracker/view.php?id=324.
The problem is that we execute the following command:
lsedit /SYS$SCRATCH/svn-commit.1.tmp
which fails due to malformed pathspec.
AFAIU such path was builded as a result of Unix-VMS pathspec mapping. Description of that mapping I found here -- http://h18000.www1.hp.com/java/documentation/1.4.2/ovms/docs/user_guide.html#unix_style
On one hand we need that mapping since we read from/write to the file, on the other hand we have to put correct path to lsedit parameters.
So, did anyone here get the same problem, is there any workaround for the issue?
Thanks in advance!
-- Semjon.
Solved! Go to Solution.
- Tags:
- Subversion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2009 09:01 AM
тАО11-25-2009 09:01 AM
SolutionHere? Run a JNI call into the editor and see how far you get; the entry points here are LSE$LSE and LSE$EDIT.
Details:
http://h71000.www7.hp.com/doc/82final/decset/6355_pro.pdf
And if you want to pass file specifications to LSEDIT or most anything else on OpenVMS (outside of the GNV environment and commands), then you need to convert to and use OpenVMS specifications.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2009 09:08 AM
тАО11-25-2009 09:08 AM
Re: Java: Runtime#exec lsedit "/tmp/file/path" fails.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2009 09:47 AM
тАО11-25-2009 09:47 AM
Re: Java: Runtime#exec lsedit "/tmp/file/path" fails.
A few lines of C and a call to decc$to_vms should do the trick. Maybe someone will be kind of to post some example code.
Otherwise, you would be hand-mangling the paths in Java with string manipulation, which is ugly and fragile.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2009 09:54 AM
тАО11-25-2009 09:54 AM
Re: Java: Runtime#exec lsedit "/tmp/file/path" fails.
$ DEFINE JAVA$EXEC_TRACE TRUE
before starting Java and see what execvp() gets as arguments.
As mentioned in a few other entries in this forum, you can not pass a DCL verb to execvp, you can only pass executables and command files.
That is, you need to start /sys$system/lsedit.exe But that only works if LSE can be started with "mc lsedit".
So you may want to create a command file to start LSE.
It depends on your java code, where the input and output go to. They are likely redirected (to VMS mailboxes). You may want to define LSE$DISPLAY_MANAGER as DECWINDOWS and that may get you an input and output devices to work with LSE.
That leaves you with the Unix file spec. You can play with the ^UP^ prefix. On recent versions and FTs of VMS hat should work with logicals like sys$scratch or with a directory sys$scratch in the Posix root. (SET/SHOW ROOT). Before passing that to Java I would try that on the command line.$ dir "^UP^/sys$scratch/*.*". Or you can put some name translation code in the command file.
Seems a lot of work/hacks to me to get it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2009 10:35 AM
тАО11-25-2009 10:35 AM
Re: Java: Runtime#exec lsedit "/tmp/file/path" fails.
http://www.mpp.mpg.de/~huber/util/main/unix_to_vms.C
This is (inexplicably) one of the most complex APIs available in C.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-26-2009 12:54 PM
тАО11-26-2009 12:54 PM
Re: Java: Runtime#exec lsedit "/tmp/file/path" fails.
Unfortunately I'm not experienced OpenVMS user, and I have no OpenVMS machine available. So far I put a link to this discussion at our bug tracker to let user get overview of the problem.
The following workaround seems to be good for me:
1. User creates a command file, which is responsible for converting Unix-style path to OpenVMS specification and for running 'lsedit' executable.
2. Specifies SVN_EDITOR variable to use that new command file.
Here is what should happen (schematically):
1. File tmpFile = new File(tmpDir, "svn-commit.1.tmp").
2. Write initial data to tmpFile.
3. String editorCmd = getProperty("SVN_EDITOR")
4. Runtime#exec(editorCmd, tmpFile.getAbsolutePath())
5. Command file executed, /SYS$SCRATCH/svn-commit.1.tmp passed as a parameter to it.
6. Command file converts "/SYS$SCRATCH/svn-commit.1.tmp" to "SYS$SCRACTH:svn-commit.1.tmp" and executes "sys$system:lsedit.exe SYS$SCRACTH:svn-commit.1.tmp".
7. lsedit exists, command file exits. We get commit message available from tmpFile.
Correct me please, if I'm mistaken.
And thanks a lot for your prompt replies!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-26-2009 02:00 PM
тАО11-26-2009 02:00 PM
Re: Java: Runtime#exec lsedit "/tmp/file/path" fails.
That would likely be incorrect; you probably do have access to OpenVMS systems. Here are two:
telnet deathrow.vistech.net
telnet decuserve.org
Sign up for a free account.
>1. User creates a command file, which is responsible for converting Unix-style path to OpenVMS specification and for running 'lsedit' executable.
Tossing this task off onto the end-users means everybody gets to fix this all over the place. That's not really a solution. That's something approaching chaos.
>2. Specifies SVN_EDITOR variable to use that new command file.
There are already mechanisms in OpenVMS for this, including callable APIs embedded within the editors.
Here, that "variable" would be a logical name that specifies the editor, as well. Or an option in a configuration file. There are other ways...
In general, this is an area that works entirely different from Unix, too. Various tools on OpenVMS (including editors) can be invoked under program control. Pulling a Unix solution directly over probably won't make anybody happy, either.
>Here is what should happen (schematically):
1. File tmpFile = new File(tmpDir, "svn-commit.1.tmp").
2. Write initial data to tmpFile.
3. String editorCmd = getProperty("SVN_EDITOR")
4. Runtime#exec(editorCmd, tmpFile.getAbsolutePath())
5. Command file executed, /SYS$SCRATCH/svn-commit.1.tmp passed as a parameter to it.
6. Command file converts "/SYS$SCRATCH/svn-commit.1.tmp" to "SYS$SCRACTH:svn-commit.1.tmp" and executes "sys$system:lsedit.exe SYS$SCRACTH:svn-commit.1.tmp".
7. lsedit exists, command file exits. We get commit message available from tmpFile.
>Correct me please, if I'm mistaken.
That looks like real work.
I'd probably just open a file in the /tmp/filename.txt area and write stuff there (or via the mktemp routines or such), and then invoke the editor against the file in SYS$SCRATCH:filename.txt via spawn or (more elegantly) via the callable API. tmp maps to SYS$SCRATCH.
Here's an example of both the callable API and the approach using a DCL command and the lib$spawn operation:
http://labs.hoffmanlabs.com/node/1447
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-26-2009 03:57 PM
тАО11-26-2009 03:57 PM
Re: Java: Runtime#exec lsedit "/tmp/file/path" fails.
$! file: lse.com
$ set proc/parse=ext
$ define sys$input 'f$log("tt")
$ define sys$output 'f$log("tt")
$ define sys$error 'f$log("tt")
$ p2= p2-"/SYS$SCRATCH/"
$ f=f$search("sys$scratch:''p2'")
$ define/user sys$command 'f$log("tt")
$ lse 'f
Make sure there is no file SYS$SCRATCH:svn-commit*.tmp.
And then try
$ jsvn ci --editor-cmd ./lse.com
jsvn creates temporary commit files svn-commit.tmp and if that exists svn-commit.1.tmp and if that exists svn-commit.2.tmp and ...
On VMS these files can end up as SVN-COMMIT.TMP, SVN-COMMIT_1.TMP, SVN-COMMIT_2.TMP
While testing this I couldn't convince JSVN (Java?) to create the dot in the name. P2 (yes, P2!) contains the filename as "/SYS$SCRATCH/svn-commit.1.tmp". That is not easy to match with SVN-COMMIT_2.TMP.
Good luck.
PS: For testing you may want the commit, that is the lse.com to fail, an appended "$ exit 42" comes handy.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-27-2009 12:25 AM
тАО11-27-2009 12:25 AM