Hi Ediwin,

Thanks a lot.

I tried with the below command it worked fine.
p = rt.exec(new String[]{"sh", "-c", CLAM_SCAN + destFilePath +
File.separatorChar + "\"" + fileName + "\"" });


Regards,
M.Sudhakar

On Fri, Dec 19, 2008 at 7:47 AM, Török Edwin <[email protected]> wrote:
> On 2008-12-19 14:03, Sudhakar Marimuthu wrote:
>> Hi ,
>> i am running clamscan from java as given below.
>> i am getting 56 as a return code.
>>
>> Param with Value
>> ---------------------------
>> destFilePath = /home/sudhakar/
>> fileName=Test Scan.doc (filename with space)
>>
>> Method
>> -----------------------
>> private  void scanAntiVirus(String destFilePath, String fileName){
>>         Process p;
>>         int status;
>>         String absoulatepath= destFilePath + "/" + fileName;
>>               try {
>>                       String  command = CLAM_SCAN + destFilePath + "\"" + 
>> fileName + "\"";
>>
>
> I have no idea what Java does with quoted arguments, but why use
> rt.exec(String) at all?
>
> Just use rt.exec(String[]) like this:
>    rt.exec(new String[]{CLAM_SCAN, destFilePath + File.separatorChar +
> fileName});
>
> Also you should be running clamd, and using clamdscan since that is a
> lot faster!
>
> Best regards,
> --Edwin
> _______________________________________________
> Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
> http://www.clamav.net/support/ml
>
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml

Reply via email to