Net::SFTP setting permissions (and voluminous STDERR output)

A

Arvin Portlock

Hello, I've recently begun using Net::SFTP to automate the
nightly transfer of files from a Windows 2000 machine to
a unix computer. Let me begin by bitching a bit, though. Why
does there seem to be culture among Unix programmers that
abhors examples in documentation? Is there some unspoken
documentation guidelines that Unix programmers are initiated
into which encourages the appearance of arcane and forbidden
knowledge? Or is it just a union thing? I mean, sure, I see
the utility in this sort opf thing:

/usr/bin/fnord [ -aAbcCdfFgilLmnopqrRstux1 ] [ file ... ]

But is it too much to ask for a few concrete examples a
little bit later in the documentation?

OK, I feel better now.

I'm trying to set the permissions on a directory I am creating
through Net::SFTP. I can only assume these permissions are set
using some octal code:

my $dir_attrs = new Net::SFTP::Attributes;
$dir_attrs->perm (0755);
$sftp->do_mkdir ("$remote_dir/temp", $dir_attrs);

But the permission instruction seems to be ignored (just
for fun I also tried $dir_attrs->perm ('drwxr-xr-x'); but
that was ignored as well). I wanted to import some
Net::SFTP::Constant's but gave up on that pretty quickly
(no examples). Has anybody done this with Net::SFTP? What
am I doing wrong?

Another problem is that when I turn off SFTP's debug I still get
a large number of messages sent to STDERR:

IO::Socket::INET at D:/apps/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at D:/apps/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
IO::Socket::INET at D:/apps/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at D:/apps/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
IO::String at D:/apps/Perl/site/lib/Net/SSH/Perl/Channel.pm line 118
.... etc.

I would like to turn these off without getting rid of ALL STDERR.
Does anybody know where these messages come from? Are they errors,
warnings, simply something interesting to watch while you wait?
The program seems to be working as it should (except for the
permissions problem).

Arvin
 
L

Larry

Arvin said:
Is there some unspoken
documentation guidelines that Unix programmers are initiated
into which encourages the appearance of arcane and forbidden
knowledge? Or is it just a union thing?

I think the guidelines are: do as little documentation as you can get
away with because hacking is more fun than writing documentation.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top