cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Mailing List Archives

Re: Corrupt downloaded file

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

On 31 October 2010 18:05, Iskander Ben mahmoud <salexandre.bm_at_gmail.com> 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.

Try:

$ 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 <esiotrot_at_gmail.com>
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-10-31

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET