Thanks for the reply Steven.

I've since discovered that using wget with HTTP of course cannot
preserve permissions as is has no idea what they are!

I had a strange idea that maybe they could be read in the header
somehow, but was sorely mistaken.

I've just added a chmod into my script after the wget instead :-)

On 28/02/07, Steven M. Schweda <[EMAIL PROTECTED]> wrote:
From Andrew Hall:

   As usual, it might help to have some basic information, like the wget
version, the system type and OS on which it's being run, and an actual
wget command.

> I notice when using wget -O that execute permissions on files are not
> preserved.

   With "-O", wget opens the output file before it talks to the server,
so it doesn;t have that information at that time.  Wget (including with
"-O") allows a user to fetch multiple files with one command.  Whose
file permissions would you like it to use?  "-O" does not work the way
many (most?) people seem to think that it does, which leads to faulty
expectations.

> So a file which on the webserver is rwxr-xr-x will be written as
> rw-r--r--

   With your umask, I'd expect that _any_ file which you can get the Web
server to send will be written with rw-r--r--.  In most cases, file
permissions on a Web server are not even available to the client.  An
FTP server is more likely to supply this kind of info.

> Is this intentional?

   I'd say it was more accidental than intentional.

> Is there a way I can preserve execute permissions?

   The easiest way might be to use FTP and not "-O".  Which do you like
better after a download, "mv" or "chmod"?  And how do you know which
permissions the file had originally?

------------------------------------------------------------------------

   Steven M. Schweda               [EMAIL PROTECTED]
   382 South Warwick Street        (+1) 651-699-9818
   Saint Paul  MN  55105-2547

Reply via email to