Change file permissions via FTP

L

Luca Scatigno

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
 
L

Lars Haugseth

* Luca Scatigno said:
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
 
L

Luca Scatigno

Lars said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top