From: ts Date: 2004-05-28T22:00:41+09:00 Subject: Re: net/ftp problem >>>>> "G" == Greg Brondo writes: G> I'm trying to recurse a directory and chmod the files on a remote ftp site. G> What happens in the code works for the root directory then when it hits a G> child directory and calls the chmod function recursively it hangs on the G> next access of the 'conn' object. I cannot figure it out. Here's the G> code: You can't mix 2 ftp commands G> conn.list() { |entry| you send the command LIST G> fileName = entry.split()[8] G> print_info("CHMOD #{PERMISSIONS} #{fileName}") G> conn.sendcmd("SITE CHMOD #{PERMISSIONS} #{fileName}") G> if entry =~ /^d/ # It's a directory G> chmod_files(conn, fileName) you call recursively chmod_files(). This mean that you'll send a command LIST when the previous is not yet finished. You must call #list without a block, to be sure that the command is finished when you recurse G> conn.chdir("..") -- Guy Decoux