Version 0 of Answered Questions On: HTTP/FTP Etc

Updated 2004-10-28 10:52:47



TABLE OF CONTENTS (HTTP/FTP Etc):

  • Why Does My File Change From Read-Only Mode To Non-Read-Only Mode, When I FTP It?

Why Does My File Change From Read-Only Mode To Non-Read-Only Mode, When I FTP It?

I am trying to ftp a file using TCL. The file is in a readonly mode in my source directory. but after i do a ftp, the file changes to non readonly mode (something i do not want .. i still want the file to be readonly).. i am using dos ftp .. any pointers will be aqppreciated. Ashish

March 3rd: It sounds like that's a bug in the ftp package. Whether this is the correct/best solution, I'm not sure, but you could cache the readonly value and reset it later with something like...

  set ro [file attributes $filename -readonly]
  <insert FTP code here>
  file attributes $filename -readonly $ro

2004/10/26 - e0richt

I don't believe that FTP is supposed to preserve file modes. I had a similar problem working on a RS/6000 box. You will either have to set the file attributes after transfer or if you had a lot of files you could ftp a .tar file which will preserve file attributes when it is unrolled.