Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Change file permissions via FTP

Reply
Thread Tools

Change file permissions via FTP

 
 
Luca Scatigno
Guest
Posts: n/a
 
      06-04-2009
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-forum.com/.

 
Reply With Quote
 
 
 
 
Lars Haugseth
Guest
Posts: n/a
 
      06-08-2009
* Luca Scatigno <> 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
 
Reply With Quote
 
 
 
 
Luca Scatigno
Guest
Posts: n/a
 
      06-08-2009
Lars Haugseth wrote:
> * Luca Scatigno <> 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-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
In-depth documenation on User Permissions, Group Permissions, ACLs, DCLs etc. Curt K ASP .Net 0 11-03-2006 04:54 PM
Upload file to server via asp without changing file permissions N. Quisitive ASP General 0 01-17-2006 12:33 AM
ASPX file returning obscur runtime error - after changing permissions to a subweb (.net app) to different permissions than on its parent ? Isabelle ASP .Net 0 08-11-2004 02:04 PM
Re: Permissions - giving "everyone" full permissions is bad ? Scott Allen ASP .Net 0 07-13-2004 08:54 PM
Net::FTP problems getting files from Windows FTP server, but not Linux FTP Server. D. Buck Perl Misc 2 06-29-2004 02:05 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57