cURL / Mailing Lists / curl-library / Single Mail


Re: Corrupt downloaded file

From: Michael Wood <>
Date: Sun, 31 Oct 2010 20:53:30 +0200

On 31 October 2010 18:05, Iskander Ben mahmoud <> wrote:
> Hello every body,
> i'm working on an application that use libcurl, and and add some function to
> download automatically the update if it exists.
> i'm on ubuntu and coding on c and i'm using gcc to compile files.
> The problem is when i try to download th update, it works, the file is
> completely downloaded but i cant excute it i got this message fox exemple :
> ./application_V2
> bash: ./application_V2 : Permession not accorded

When you download something it will not automatically be executable.
You will need to make it executable manually using the chmod command
or the chmod() or fchmod() C functions. Or else when you open the
file for writing using the open() function, you can specify that the
file should have the execute bits set.


$ chmod u+x application_V2
$ ./application_V2

> if i use
> sudo ./application_V2
> i got :
> sudo: ./application_V2: command not found

sudo is not magic :)

> note that the original file works and the downloaded file is not.
> Any idea how to correct this ?

Make sure that you have told the operating system that you want to be
able to execute the file.

Michael Wood <>
List admin:
Received on 2010-10-31