[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Change file permissions via FTP

Luca Scatigno

6/4/2009 4:26:00 PM

Hi,

I have to upload a file via FTP and then change its permissions, i'm
using
net/ftp but i don't know how to change the perms.
How can I do that?
Should I use another library?

Thanks in advance.

Luca
--
Posted via http://www.ruby-....

2 Answers

Lars Haugseth

6/8/2009 11:38:00 AM

0

* Luca Scatigno <skatz82@gmail.com> wrote:
>
> Hi,
>
> I have to upload a file via FTP and then change its permissions, i'm
> using
> net/ftp but i don't know how to change the perms.
> How can I do that?

Not tested, but have you tried something like this?

Net::FTP.open(host) do |conn|
< login/chdir/upload code here >
response = conn.sendcmd("SITE CHMOD 0664 #{filename}")
end

--
Lars Haugseth

Luca Scatigno

6/8/2009 12:10:00 PM

0

Lars Haugseth wrote:
> * Luca Scatigno <skatz82@gmail.com> wrote:
>>
>> Hi,
>>
>> I have to upload a file via FTP and then change its permissions, i'm
>> using
>> net/ftp but i don't know how to change the perms.
>> How can I do that?
>
> Not tested, but have you tried something like this?
>
> Net::FTP.open(host) do |conn|
> < login/chdir/upload code here >
> response = conn.sendcmd("SITE CHMOD 0664 #{filename}")
> end

Thanks Lars,
I've tried your suggestion and it works. It solved my problem.
--
Posted via http://www.ruby-....