File: Impl.html

package info (click to toggle)
libnet-sftp-ruby 1.1.1-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,444 kB
  • ctags: 854
  • sloc: ruby: 4,216; makefile: 14
file content (248 lines) | stat: -rw-r--r-- 10,336 bytes parent folder | download | duplicates (2)
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
<?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>Class: Net::SFTP::Protocol::V_04::Impl</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">Class</span><br />Net::SFTP::Protocol::V_04::Impl</td>
  <td align="right">
    <table cellspacing=0 cellpadding=2>
      <tr valign="top">
        <td>In:</td>
        <td>
<a href="../../../../../files/lib/net/sftp/protocol/04/impl_rb.html">lib/net/sftp/protocol/04/impl.rb</a>
        </td>
      </tr>
    <tr>
      <td>Parent:</td>
      <td>
V_03::Impl
     </td>
   </tr>
         </table>
        </td>
        </tr>
      </table>
 <!-- banner header -->

  <div id="bodyContent">
      <div id="content">

  <div class="description"><p>
The implementation of the operations available to version 4 of the <a
href="../../../SFTP.html">SFTP</a> protocol.
</p>
</div>



  <div class="sectiontitle">Methods</div>
  <ul>
  <li><a href="#M000069">do_name</a></li>
  <li><a href="#M000067">fstat</a></li>
  <li><a href="#M000066">lstat</a></li>
  <li><a href="#M000068">rename</a></li>
  <li><a href="#M000065">stat</a></li>
  </ul>






<div class="sectiontitle">Public Instance methods</div>
<div class="method">
  <div class="title">
    <a name="M000069"></a><b>do_name</b>( channel, content )
  </div>
  <div class="description">
  <p>
Used internally to handle <tt>name</tt> packets. The <tt>on_name</tt>
callback is invoked, if registered, with the driver, id, and array of
items. The v4 version of this method sets the &#8216;longname&#8217; member
of the Name object to <tt>nil</tt> (it is not used in this version).
</p>
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000069_source')" id="l_M000069_source">show source</a> ]</p>
  <div id="M000069_source" class="dyn-source">
<pre>
    <span class="ruby-comment cmt"># File lib/net/sftp/protocol/04/impl.rb, line 73</span>
73:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">do_name</span>( <span class="ruby-identifier">channel</span>, <span class="ruby-identifier">content</span> )
74:       <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">has_on_name?</span>
75:       <span class="ruby-identifier">id</span> = <span class="ruby-identifier">content</span>.<span class="ruby-identifier">read_long</span>
76:       <span class="ruby-identifier">items</span> = []
77:       <span class="ruby-identifier">content</span>.<span class="ruby-identifier">read_long</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span>
78:         <span class="ruby-identifier">items</span>.<span class="ruby-identifier">push</span>( <span class="ruby-constant">Name</span>.<span class="ruby-identifier">new</span>( <span class="ruby-identifier">content</span>.<span class="ruby-identifier">read_string</span>, <span class="ruby-keyword kw">nil</span>,
79:           <span class="ruby-ivar">@attr_factory</span>.<span class="ruby-identifier">from_buffer</span>( <span class="ruby-identifier">content</span> ) ) )
80:       <span class="ruby-keyword kw">end</span>
81:       <span class="ruby-identifier">call_on_name</span>( <span class="ruby-identifier">driver</span>, <span class="ruby-identifier">id</span>, <span class="ruby-identifier">items</span> )
82:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000067"></a><b>fstat</b>( id, handle, flags=nil )
  </div>
  <div class="description">
  <p>
In version 4, <a href="Impl.html#M000067">fstat</a> accepts a flags
parameter. If flags is <tt>nil</tt>, it will default to returning all
attributes. Otherwise, the flags parameter should be a bitwise combination
of the F_xxx constants of <a
href="Attributes.html">Net::SFTP::Protocol::V_04::Attributes</a>.
</p>
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000067_source')" id="l_M000067_source">show source</a> ]</p>
  <div id="M000067_source" class="dyn-source">
<pre>
    <span class="ruby-comment cmt"># File lib/net/sftp/protocol/04/impl.rb, line 45</span>
45:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fstat</span>( <span class="ruby-identifier">id</span>, <span class="ruby-identifier">handle</span>, <span class="ruby-identifier">flags</span>=<span class="ruby-keyword kw">nil</span> )
46:       <span class="ruby-identifier">fstat_raw</span> <span class="ruby-identifier">id</span>, <span class="ruby-identifier">handle</span>, <span class="ruby-identifier">convert_flags</span>( <span class="ruby-identifier">flags</span> )
47:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000066"></a><b>lstat</b>( id, filename, flags=nil )
  </div>
  <div class="description">
  <p>
In version 4, <a href="Impl.html#M000066">lstat</a> accepts a flags
parameter. If flags is <tt>nil</tt>, it will default to returning all
attributes. Otherwise, the flags parameter should be a bitwise combination
of the F_xxx constants of <a
href="Attributes.html">Net::SFTP::Protocol::V_04::Attributes</a>.
</p>
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000066_source')" id="l_M000066_source">show source</a> ]</p>
  <div id="M000066_source" class="dyn-source">
<pre>
    <span class="ruby-comment cmt"># File lib/net/sftp/protocol/04/impl.rb, line 37</span>
37:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lstat</span>( <span class="ruby-identifier">id</span>, <span class="ruby-identifier">filename</span>, <span class="ruby-identifier">flags</span>=<span class="ruby-keyword kw">nil</span> )
38:       <span class="ruby-identifier">lstat_raw</span> <span class="ruby-identifier">id</span>, <span class="ruby-identifier">filename</span>, <span class="ruby-identifier">convert_flags</span>( <span class="ruby-identifier">flags</span> )
39:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000068"></a><b>rename</b>( id, name, new_name, flags=0 )
  </div>
  <div class="description">
  <p>
In version 4, <a href="Impl.html#M000068">rename</a> accepts a flags
parameter. The valid flags are a combination of the following:
</p>
<ul>
<li>FXP_RENAME_OVERWRITE (0x01)

</li>
<li>FXP_RENAME_ATOMIC (0x02)

</li>
<li>FXP_RENAME_NATIVE (0x04)

</li>
</ul>
<p>
Please refer to the SSH2 specification for the description of these flags.
</p>
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000068_source')" id="l_M000068_source">show source</a> ]</p>
  <div id="M000068_source" class="dyn-source">
<pre>
    <span class="ruby-comment cmt"># File lib/net/sftp/protocol/04/impl.rb, line 57</span>
57:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rename</span>( <span class="ruby-identifier">id</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">new_name</span>, <span class="ruby-identifier">flags</span>=<span class="ruby-value">0</span> )
58:       <span class="ruby-identifier">rename_raw</span> <span class="ruby-identifier">id</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">new_name</span>, <span class="ruby-identifier">flags</span>
59:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000065"></a><b>stat</b>( id, filename, flags=nil )
  </div>
  <div class="description">
  <p>
In version 4, <a href="Impl.html#M000065">stat</a> accepts a flags
parameter. If flags is <tt>nil</tt>, it will default to returning all
attributes. Otherwise, the flags parameter should be a bitwise combination
of the F_xxx constants of <a
href="Attributes.html">Net::SFTP::Protocol::V_04::Attributes</a>.
</p>
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000065_source')" id="l_M000065_source">show source</a> ]</p>
  <div id="M000065_source" class="dyn-source">
<pre>
    <span class="ruby-comment cmt"># File lib/net/sftp/protocol/04/impl.rb, line 29</span>
29:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stat</span>( <span class="ruby-identifier">id</span>, <span class="ruby-identifier">filename</span>, <span class="ruby-identifier">flags</span>=<span class="ruby-keyword kw">nil</span> )
30:       <span class="ruby-identifier">stat_raw</span> <span class="ruby-identifier">id</span>, <span class="ruby-identifier">filename</span>, <span class="ruby-identifier">convert_flags</span>( <span class="ruby-identifier">flags</span> )
31:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
</div>

  </div>

    </body>
</html>