f



problem executing a command with JAVA under windows...

Hi,

I am trying to execute this command :
D:\Progra~1\curl --disable-epsv  -T
D:\abonnement\fichierOCOV\UTISG30\OC_20040928_9H15_163348837.csv -u
glldadm:glldadm ftp://dsfb/temp/curl/ -D D:\curlOC.log

using JAVA.

So i use the Runtime.exec method :
(...)
String[] command = new String[10];
    command[0]  = "D:\\Progra~1\\curl";
    command[1]  = "--disable-epsv";
    command[2]  = "";
    command[3]  = "-T";
    command[4]  = "D:\\abonnement\\fichierOCOV\\UTISG30\\OC_20040928_9H15_163348837.csv";
    command[5]  = "-u";
    command[6]  = "glldadm:glldadm";
    command[7]  = "ftp://dsfb/temp/curl/";
    command[8]  = "-D";
    command[9]  = "D:\\curlOC.log";

    byte[] buffer = new byte[1024];
    int count;

    InputStream input = null;
    try{
	    
    input = Runtime.getRuntime().exec(command).getInputStream();
    }
    catch (IOException e)
    {
	    throw new CommonException("Pb dans
l'ex´┐Żcution...\n"+e.getMessage(),e);
    }
(...)

but it does not work.

I have got an error :
(...)
CreateProcess: D:\Progra~1\curl --disable-epsv  -T
D:\abonnement\fichierOCOV\UTISG30\OC_20040928_9H15_163348837.csv -u
glldadm:glldadm ftp://dsfb/temp/curl/ -D D:\curlOC.log  error=5
java.io.IOException: CreateProcess: D:\Progra~1\curl --disable-epsv 
-T D:\abonnement\fichierOCOV\UTISG30\OC_20040928_9H15_163348837.csv -u
glldadm:glldadm ftp://dsfb/temp/curl/ -D D:\curlOC.log  error=5
	java.lang.Throwable(java.lang.String)
	java.lang.Exception(java.lang.String)
	java.io.IOException(java.lang.String)
	int java.lang.Win32Process.create(java.lang.String, java.lang.String,
java.io.FileDescriptor, java.io.FileDescriptor,
java.io.FileDescriptor)
	java.lang.Win32Process(java.lang.String [], java.lang.String [])
	java.lang.Process java.lang.Runtime.execInternal0(java.lang.String
[], java.lang.String [])
	java.lang.Process java.lang.Runtime.exec(java.lang.String [],
java.lang.String [])
	java.lang.Process java.lang.Runtime.exec(java.lang.String [])
	void com.socgen.passif.client.technical.load.ordre.FileOCOVLoadManager.sendFileByFTP(java.lang.String,
java.lang.String)
	void com.socgen.passif.client.technical.load.ordre.FileOCOVLoadManager.createNewFile(com.socgen.passif.data.VueSuiviFichier,
java.io.File, com.socgen.passif.data.VueUtilisateur,
com.socgen.passif.server.ejb.session.abonnement.AbonnementService,
com.socgen.passif.data.technical.VueFichierEtatSortie,
com.socgen.passif.enumeration.TypeTransfert, java.lang.String)
	void com.socgen.passif.client.technical.load.ordre.FileOCOVLoadManager.createAllFiles(com.socgen.passif.data.VueSuiviFichier,
java.io.File, java.util.HashMap,
com.socgen.passif.data.VueUtilisateur)
	void com.socgen.passif.client.technical.load.ordre.FileOCOVLoadManager.processCreateAllFiles(com.socgen.passif.data.VueSuiviFichier,
java.util.HashMap)
	void com.socgen.passif.client.technical.load.ordre.FileOCOVLoadManager.postFileLoad(com.socgen.passif.data.VueSuiviFichier)
	void com.socgen.passif.client.technical.load.FileLoadManager.processFilesToLoad()
	void com.socgen.passif.client.technical.load.ordre.FileOCLoadManager.processAllOCFiles()
	java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object,
java.lang.Object [])
	void com.socgen.passif.client.technical.scheduler.ThreadManager.run()
(...)

which i can not solve. can somebody help me ?

THANX !!!
0
naudjf (2)
11/23/2004 3:46:07 PM
comp.lang.java.help 13339 articles. 0 followers. Post Follow

2 Replies
394 Views

Similar Articles

[PageSpeed] 16

On 23 Nov 2004 07:46:07 -0800, naud wrote:

> ..D:\Progra~1\curl ...

Are you certain Windows treats that name the same in all 
circumstances?  As I understand, 'Progra~1' is an abbreviation 
for a longer name, is that correct?

You might try the command with the full path name.

-- 
Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane
0
SeeMySites (5478)
11/23/2004 3:56:43 PM
> CreateProcess: D:\Progra~1\curl --disable-epsv  -T
> D:\abonnement\fichierOCOV\UTISG30\OC_20040928_9H15_163348837.csv -u
> glldadm:glldadm ftp://dsfb/temp/curl/ -D D:\curlOC.log  error=5
> java.io.IOException: CreateProcess: D:\Progra~1\curl --disable-epsv 
> -T D:\abonnement\fichierOCOV\UTISG30\OC_20040928_9H15_163348837.csv -u
> glldadm:glldadm ftp://dsfb/temp/curl/ -D D:\curlOC.log  error=5
>      java.lang.Throwable(java.lang.String)
>      java.lang.Exception(java.lang.String)
>      java.io.IOException(java.lang.String)
>      int java.lang.Win32Process.create(java.lang.String,

AFAIK error=5 means "Access is denied"

Bye.
-- 
Real Gagnon  from  Quebec, Canada
* Looking for Java or PB snippets ? Visit Real's How-to  
* http://www.rgagnon.com/howto.html
0
Real
11/24/2004 1:53:38 AM
Reply: