clamav-users December 2008 archive
Main Archive Page > Month Archives  > clamav-users archives
clamav-users: Re: [Clamav-users] 56: Can't stat input file or di

Re: [Clamav-users] 56: Can't stat input file or directory. File / directory you want to scan doesn't

From: Sudhakar Marimuthu <sudhakarmuthu_at_nospam>
Date: Fri Dec 19 2008 - 13:43:44 GMT
To: "ClamAV users ML" <clamav-users@lists.clamav.net>


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 <edwintorok@gmail.com> 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