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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Module: Net::SFTP</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
<script language="JavaScript" type="text/javascript">
// <![CDATA[
function toggleSource( id )
{
var elem
var link
if( document.getElementById )
{
elem = document.getElementById( id )
link = document.getElementById( "l_" + id )
}
else if ( document.all )
{
elem = eval( "document.all." + id )
link = eval( "document.all.l_" + id )
}
else
return false;
if( elem.style.display == "block" )
{
elem.style.display = "none"
link.innerHTML = "show source"
}
else
{
elem.style.display = "block"
link.innerHTML = "hide source"
}
}
function openCode( url )
{
window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" )
}
// ]]>
</script>
</head>
<body>
<table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
<td class="file-title"><span class="file-title-prefix">Module</span><br />Net::SFTP</td>
<td align="right">
<table cellspacing=0 cellpadding=2>
<tr valign="top">
<td>In:</td>
<td>
<a href="../../files/lib/net/sftp/errors_rb.html">lib/net/sftp/errors.rb</a>
<a href="../../files/lib/net/sftp/operations/abstract_rb.html">lib/net/sftp/operations/abstract.rb</a>
<a href="../../files/lib/net/sftp/operations/close_rb.html">lib/net/sftp/operations/close.rb</a>
<a href="../../files/lib/net/sftp/operations/errors_rb.html">lib/net/sftp/operations/errors.rb</a>
<a href="../../files/lib/net/sftp/operations/fsetstat_rb.html">lib/net/sftp/operations/fsetstat.rb</a>
<a href="../../files/lib/net/sftp/operations/fstat_rb.html">lib/net/sftp/operations/fstat.rb</a>
<a href="../../files/lib/net/sftp/operations/lstat_rb.html">lib/net/sftp/operations/lstat.rb</a>
<a href="../../files/lib/net/sftp/operations/mkdir_rb.html">lib/net/sftp/operations/mkdir.rb</a>
<a href="../../files/lib/net/sftp/operations/open_rb.html">lib/net/sftp/operations/open.rb</a>
<a href="../../files/lib/net/sftp/operations/opendir_rb.html">lib/net/sftp/operations/opendir.rb</a>
<a href="../../files/lib/net/sftp/operations/read_rb.html">lib/net/sftp/operations/read.rb</a>
<a href="../../files/lib/net/sftp/operations/readdir_rb.html">lib/net/sftp/operations/readdir.rb</a>
<a href="../../files/lib/net/sftp/operations/realpath_rb.html">lib/net/sftp/operations/realpath.rb</a>
<a href="../../files/lib/net/sftp/operations/remove_rb.html">lib/net/sftp/operations/remove.rb</a>
<a href="../../files/lib/net/sftp/operations/rename_rb.html">lib/net/sftp/operations/rename.rb</a>
<a href="../../files/lib/net/sftp/operations/rmdir_rb.html">lib/net/sftp/operations/rmdir.rb</a>
<a href="../../files/lib/net/sftp/operations/services_rb.html">lib/net/sftp/operations/services.rb</a>
<a href="../../files/lib/net/sftp/operations/setstat_rb.html">lib/net/sftp/operations/setstat.rb</a>
<a href="../../files/lib/net/sftp/operations/stat_rb.html">lib/net/sftp/operations/stat.rb</a>
<a href="../../files/lib/net/sftp/operations/write_rb.html">lib/net/sftp/operations/write.rb</a>
<a href="../../files/lib/net/sftp/protocol/01/attributes_rb.html">lib/net/sftp/protocol/01/attributes.rb</a>
<a href="../../files/lib/net/sftp/protocol/01/impl_rb.html">lib/net/sftp/protocol/01/impl.rb</a>
<a href="../../files/lib/net/sftp/protocol/01/packet-assistant_rb.html">lib/net/sftp/protocol/01/packet-assistant.rb</a>
<a href="../../files/lib/net/sftp/protocol/01/services_rb.html">lib/net/sftp/protocol/01/services.rb</a>
<a href="../../files/lib/net/sftp/protocol/02/impl_rb.html">lib/net/sftp/protocol/02/impl.rb</a>
<a href="../../files/lib/net/sftp/protocol/02/packet-assistant_rb.html">lib/net/sftp/protocol/02/packet-assistant.rb</a>
<a href="../../files/lib/net/sftp/protocol/02/services_rb.html">lib/net/sftp/protocol/02/services.rb</a>
<a href="../../files/lib/net/sftp/protocol/03/impl_rb.html">lib/net/sftp/protocol/03/impl.rb</a>
<a href="../../files/lib/net/sftp/protocol/03/packet-assistant_rb.html">lib/net/sftp/protocol/03/packet-assistant.rb</a>
<a href="../../files/lib/net/sftp/protocol/03/services_rb.html">lib/net/sftp/protocol/03/services.rb</a>
<a href="../../files/lib/net/sftp/protocol/04/attributes_rb.html">lib/net/sftp/protocol/04/attributes.rb</a>
<a href="../../files/lib/net/sftp/protocol/04/impl_rb.html">lib/net/sftp/protocol/04/impl.rb</a>
<a href="../../files/lib/net/sftp/protocol/04/packet-assistant_rb.html">lib/net/sftp/protocol/04/packet-assistant.rb</a>
<a href="../../files/lib/net/sftp/protocol/04/services_rb.html">lib/net/sftp/protocol/04/services.rb</a>
<a href="../../files/lib/net/sftp/protocol/05/impl_rb.html">lib/net/sftp/protocol/05/impl.rb</a>
<a href="../../files/lib/net/sftp/protocol/05/packet-assistant_rb.html">lib/net/sftp/protocol/05/packet-assistant.rb</a>
<a href="../../files/lib/net/sftp/protocol/05/services_rb.html">lib/net/sftp/protocol/05/services.rb</a>
<a href="../../files/lib/net/sftp/protocol/constants_rb.html">lib/net/sftp/protocol/constants.rb</a>
<a href="../../files/lib/net/sftp/protocol/driver_rb.html">lib/net/sftp/protocol/driver.rb</a>
<a href="../../files/lib/net/sftp/protocol/packet-assistant_rb.html">lib/net/sftp/protocol/packet-assistant.rb</a>
<a href="../../files/lib/net/sftp/protocol/services_rb.html">lib/net/sftp/protocol/services.rb</a>
<a href="../../files/lib/net/sftp/session_rb.html">lib/net/sftp/session.rb</a>
<a href="../../files/lib/net/sftp/version_rb.html">lib/net/sftp/version.rb</a>
<a href="../../files/lib/net/sftp_rb.html">lib/net/sftp.rb</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- banner header -->
<div id="bodyContent">
<div id="content">
<div class="sectiontitle">Methods</div>
<ul>
<li><a href="#M000004">start</a></li>
</ul>
<div class="sectiontitle">Classes and Modules</div>
Module <a href="SFTP/Operations.html" class="link">Net::SFTP::Operations</a><br />
Module <a href="SFTP/Protocol.html" class="link">Net::SFTP::Protocol</a><br />
Module <a href="SFTP/Version.html" class="link">Net::SFTP::Version</a><br />
Class <a href="SFTP/Bug.html" class="link">Net::SFTP::Bug</a><br />
Class <a href="SFTP/Exception.html" class="link">Net::SFTP::Exception</a><br />
Class <a href="SFTP/Session.html" class="link">Net::SFTP::Session</a><br />
<div class="sectiontitle">Public Instance methods</div>
<div class="method">
<div class="title">
<a name="M000004"></a><b>start</b>( *args, &block )
</div>
<div class="description">
<p>
A convenience method for starting a standalone <a href="SFTP.html">SFTP</a>
session. It will <a href="SFTP.html#M000004">start</a> up an SSH session
using the given arguments (see the documentation for Net::SSH::Session for
details), and will then <a href="SFTP.html#M000004">start</a> a new <a
href="SFTP.html">SFTP</a> session with the SSH session. If a block is
given, it will be passed to the <a href="SFTP.html">SFTP</a> session.
</p>
</div>
<div class="sourcecode">
<p class="source-link">[ <a href="javascript:toggleSource('M000004_source')" id="l_M000004_source">show source</a> ]</p>
<div id="M000004_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/net/sftp.rb, line 33</span>
33: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>( <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span> )
34: <span class="ruby-identifier">session</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">SSH</span>.<span class="ruby-identifier">start</span>( <span class="ruby-operator">*</span><span class="ruby-identifier">args</span> )
35: <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">SFTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Session</span>.<span class="ruby-identifier">new</span>( <span class="ruby-identifier">session</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span> )
36: <span class="ruby-keyword kw">ensure</span>
37: <span class="ruby-identifier">session</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">session</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">block_given?</span>
38: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
|