File: dave.html

package info (click to toggle)
libhttp-dav-perl 0.38-1
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 512 kB
  • ctags: 406
  • sloc: perl: 3,618; xml: 90; makefile: 35; sh: 20
file content (541 lines) | stat: -rwxr-xr-x 17,709 bytes parent folder | download
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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>dave -- DAV Explorer</title>
<link rel="stylesheet" href="http://www.webdav.org/perldav/perldav_plain.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@localhost" />
</head>

<body>

<p><a name="__index__"></a></p>
<!-- INDEX BEGIN -->
<!--

<ul>

	<li><a href="#name">NAME</a></li>
	<li><a href="#synopsis">SYNOPSIS</a></li>
	<li><a href="#description">DESCRIPTION</a></li>
	<li><a href="#options">OPTIONS</a></li>
	<li><a href="#commands">COMMANDS</a></li>
	<li><a href="#getting_help">GETTING HELP</a></li>
	<li><a href="#installation">INSTALLATION</a></li>
	<li><a href="#what_platforms_will_it_work_on">WHAT PLATFORMS WILL IT WORK ON?</a></li>
	<li><a href="#see_also">SEE ALSO</a></li>
	<li><a href="#author_and_copyright">AUTHOR AND COPYRIGHT</a></li>
</ul>
-->
<!-- INDEX END -->

<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>dave -- DAV Explorer</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<p>dave [OPTIONS] URL</p>
<p>E.g.</p>
<pre>
   $ dave -u pcollins -p mypass www.host.org/dav_dir/
   ...
   dave&gt; get file.txt</pre>
<p>Use ``dave -h'' to get help on options</p>
<p>Use ``perldoc dave'' for the whole manpage.</p>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>dave is a powerful command-line program for interacting with WebDAV-enabled webservers. With dave you can:</p>
<ul>
<li><strong><a name="item_get_and_put_files">get and put files</a></strong>

</li>
<li><strong><a name="item_make_directories_on_a_remote_webserver">make directories on a remote webserver</a></strong>

</li>
<li><strong><a name="item_remove_files_and_directories_from_a_remote_webserv">remove files and directories from a remote webserver</a></strong>

</li>
<li><strong><a name="item_edit_a_file_on_the_webserver_with_a_single_command">edit a file on the webserver with a single command</a></strong>

</li>
<li><strong><a name="item_recursively_get_a_remote_directory">recursively get a remote directory</a></strong>

</li>
<li><strong><a name="item_recursively_put_a_local_directory">recursively put a local directory</a></strong>

</li>
<li><strong><a name="item_lock_and_unlock_remote_files_and_directories">lock and unlock remote files and directories</a></strong>

</li>
<li><strong><a name="item_securely_transfer_over_https">securely transfer over https</a></strong>

</li>
<li><strong><a name="item_authenticate_using_the_safer_digest_authentication">authenticate using the safer Digest authentication</a></strong>

</li>
</ul>
<p>Dave is a part of the PerlDAV project (http://www.webdav.org/perldav/) and is built on top of the HTTP::DAV perl API.</p>
<p>If you would like to script webdav interactions in Perl checkout the HTTP::DAV API as it's commands are the basis for dave's.</p>
<p>
</p>
<hr />
<h1><a name="options">OPTIONS</a></h1>
<dl>
<dt><strong><a name="item__2ddebug_n">-debug N</a></strong></dt>

<dd>
<p>Sets the debug level to N. 0=none. 3=noisy.</p>
</dd>
<dt><strong><a name="item__2dh">-h</a></strong></dt>

<dd>
<p>Prints basic help and options.</p>
</dd>
<dt><strong><a name="item__2dman">-man</a></strong></dt>

<dd>
<p>Prints the full manual (equivalent to perldoc dave).</p>
<p>You will need to use a pager like ``more'' or ``less''.</p>
<pre>
 e.g. dave -man |less</pre>
</dd>
<dt><strong><a name="item__2dp__3cpassword_3e">-p &lt;password&gt;</a></strong></dt>

<dd>
<p>Sets the password to be used for the URL.</p>
<p>You must also supply a user. See -u.</p>
</dd>
<dt><strong><a name="item__2du__3cusername_3e">-u &lt;username&gt;</a></strong></dt>

<dd>
<p>Sets the username to be used for the URL.</p>
<p>You must also supply a pass. See -p.</p>
</dd>
</dl>
<p>
</p>
<hr />
<h1><a name="commands">COMMANDS</a></h1>
<dl>
<dt><strong><a name="item_cd"><strong>cd URL</strong></a></strong></dt>

<dd>
<p>changes directories</p>
<pre>
   dave&gt; open host.org/dav_dir/
   dave&gt; cd dir1
   dave&gt; cd ../dir2</pre>
</dd>
<dt><strong><a name="item_cat"><strong>cat URL</strong></a></strong></dt>

<dd>
<p>shows the contents of a remote file</p>
<pre>
   dave&gt; open host.org/dav_dir/
   dave&gt; cat index.html</pre>
<p>Note: you cannot cat a directory (collection).</p>
</dd>
<dt><strong><a name="item_cp"><strong>cp</strong></a></strong></dt>

<dt><strong><a name="item_copy_source_url_dest_url"><strong>copy SOURCE_URL DEST_URL</strong></a></strong></dt>

<dd>
<p>copies one remote resource to another</p>
<pre>
  dave&gt; open host.org/dav_dir/</pre>
<p>Create a copy of dir1/ as dav2/</p>
<pre>
  dave&gt; cp dir1 dav2</pre>
<p>Create a copy of dir1/file.txt as dav2/file.txt</p>
<pre>
  dave&gt; cd dir1
  dave&gt; copy file.txt ../dav2</pre>
<p>Create a copy of file.txt as ../dav2/new_file.txt</p>
<pre>
  dave&gt; copy file.txt dav2/new_file.txt</pre>
<p>Aliases: cp</p>
</dd>
<dt><strong><a name="item_rmdir"><strong>rmdir URL</strong></a></strong></dt>

<dt><strong><a name="item_rm"><strong>rm URL</strong></a></strong></dt>

<dt><strong><a name="item_delete"><strong>delete URL</strong></a></strong></dt>

<dd>
<p>deletes a remote resource</p>
<pre>
   dave&gt; open host.org/dav_dir/
   dave&gt; delete index.html
   dave&gt; rmdir ./dir1
   dave&gt; delete /dav_dir/dir2/
   dave&gt; delete /dav_dir/*.html</pre>
<p>This command recursively deletes directories. BE CAREFUL :)</p>
<p>This command supported wildcards (globbing). See get.</p>
<p>Aliases: rm, rmdir</p>
</dd>
<dt><strong><a name="item_edit"><strong>edit URL</strong></a></strong></dt>

<dd>
<p>edits the contents of a remote file</p>
<pre>
   dave&gt; open host.org/dav_dir/
   dave&gt; edit index.html</pre>
<p>Edit is equivalent to the following sequence of commands:</p>
<pre>
   LOCK index.html (if allowed)
   GET index.html /tmp/dave.perldav.421341234124
   sh $EDITOR /tmp/dave.perldav.421341234124
   PUT index.html (if modified)
   UNLOCK index.html (if locked)</pre>
<p>Where $EDITOR is determined from the environment variables 
DAV_EDITOR or EDITOR.</p>
<p>If DAV_EDITOR is set, it will use that, otherwise it will 
use EDITOR. If neither variables are set, then ``vi'' will 
be used.</p>
<p>Notes:</p>
<p>The lock only lasts for 10 hours.</p>
<p>You cannot edit a directory (collection).</p>
<p>The temporary save directory is editable by 
editing dave and changing TMP_DIR</p>
</dd>
<dt><strong><a name="item_get_url__5bfile_5d"><strong>get URL [FILE]</strong></a></strong></dt>

<dd>
<p>downloads the file or directory at URL</p>
<p>If FILE is not specified it will be saved to your 
current working directory using the same name as 
the remote name.</p>
<pre>
  dave&gt; open host.org/dav_dir/</pre>
<p>Recursively get remote my_dir/ to .</p>
<pre>
  dave&gt; get my_dir/</pre>
<p>Recursively get remote my_dir/ to /tmp/my_dir/</p>
<pre>
  dave&gt; get my_dir /tmp</pre>
<p>Get remote my_dir/index.html to /tmp/index.html</p>
<pre>
  dave&gt; get /dav_dir/my_dir/index.html /tmp</pre>
<p>Get remote index.html to /tmp/index1.html</p>
<pre>
  dave&gt; get index.html /tmp/index1.html</pre>
<p>Use globs and save to /tmp</p>
<pre>
  dave&gt; get index* /tmp                   # Gets index*.html, index*.txt, etc.
  dave&gt; get index*.html /tmp/index1.html  # Gets index*.html
  dave&gt; get index[12].htm?                # Gets file1 and file2, .htm and .html</pre>
</dd>
<dt><strong><a name="item__3f__5bcmd_5d"><strong>? [CMD]</strong></a></strong></dt>

<dt><strong><a name="item_h__5bcmd_5d"><strong>h [CMD]</strong></a></strong></dt>

<dt><strong><a name="item_help__5bcmd_5d"><strong>help [CMD]</strong></a></strong></dt>

<dd>
<p>prints list of commands or help for CMD</p>
<pre>
  dave&gt; ?</pre>
<pre>
  dave&gt; help get</pre>
<p>Aliases: ?, h</p>
</dd>
<dt><strong><a name="item_lcd__5bdir_5d"><strong>lcd [DIR]</strong></a></strong></dt>

<dd>
<p>changes local directory</p>
<pre>
  dave&gt; lcd /tmp</pre>
</dd>
<dt><strong><a name="item_lls__5bdir_5d"><strong>lls [DIR]</strong></a></strong></dt>

<dd>
<p>lists local directory contents</p>
<pre>
  dave&gt; lcd /tmp
  dave&gt; lls
  dave&gt; lls /home</pre>
<p>This command simply execs the local ls command and is 
equivalent to ``!ls''</p>
</dd>
<dt><strong><a name="item_dir__5burl_5d"><strong>dir [URL]</strong></a></strong></dt>

<dt><strong><a name="item_ls__5burl_5d"><strong>ls [URL]</strong></a></strong></dt>

<dd>
<p>lists remote directory contents or file props</p>
<pre>
  dave&gt; ls
  Listing of <a href="http://host.org/dav_dir/">http://host.org/dav_dir/</a>
                  ./          Aug 29 02:26  &lt;dir&gt;
     mtx_0.04.tar.gz   52640  Aug 11 11:45
          index.html    4580  Aug 11 11:45
      index0.04.html    4936  Nov 11  2000
              mydir/          Aug 19 21:14  &lt;dir&gt;,&lt;locked&gt;</pre>
<pre>
  dave&gt; ls index.html
  URL: <a href="http://www.webdav.org/perldav/index.html">http://www.webdav.org/perldav/index.html</a>
  Content-type: text/html
  Creation date: Sun Aug 12 21:58:02 2001
  Last modified:
  Size: 4580 bytes
  Locks supported: write/exclusive write/shared
  Locks:</pre>
<p>Use propfind to get a similar printout of a 
collection (directory).</p>
<p>Aliases: dir</p>
</dd>
<dt><strong><a name="item_lock__5burl__5btimeout_5d__5bdepth_5d_5d"><strong>lock [URL [TIMEOUT] [DEPTH]]</strong></a></strong></dt>

<dd>
<p>locks a resource</p>
<p>Without a URL you will lock the current remote 
collection.</p>
<p>TIMEOUT can be any of the following formats:
             30s          30 seconds from now
             10m          ten minutes from now
             1h           one hour from now
             1d           tomorrow
             3M           in three months
             10y          in ten years time
             2000-02-31 00:40:33
             2000-02-31</p>
<p>Default is an infinite timeout</p>
<p>See perldoc <code>HTTP::DAV::Resource</code> for more information 
about timeouts.</p>
<p>DEPTH can be either ``0'' or ``infinity'' (default)</p>
<p>Seeting the lock Scope and Type is not currently 
implemented. Let me know if you need it as it shouldn't 
be too much effort.</p>
</dd>
<dt><strong><a name="item_mkdir"><strong>mkdir URL</strong></a></strong></dt>

<dt><strong><a name="item_mkcol"><strong>mkcol URL</strong></a></strong></dt>

<dd>
<p>make a remote collection (directory)</p>
<pre>
  dave&gt; open host.org/dav_dir/
  dave&gt; mkcol new_dir
  dave&gt; mkdir /dav_dir/new_dir</pre>
<p>Aliases: mkdir</p>
</dd>
<dt><strong><a name="item_mv"><strong>mv</strong></a></strong></dt>

<dt><strong><a name="item_move_source_url_dest_url"><strong>move SOURCE_URL DEST_URL</strong></a></strong></dt>

<dd>
<p>moves a remote resource to another</p>
<pre>
  dave&gt; open host.org/dav_dir/</pre>
<p>Move dir1/ to dav2/</p>
<pre>
  dave&gt; move dir1 dav2</pre>
<p>Move file dir2/file.txt to ../file.txt</p>
<pre>
  dave&gt; cd dir2
  dave&gt; move file.txt ..</pre>
<p>Move file.txt to dav2/new_file.txt</p>
<pre>
  dave&gt; move file.txt dav2/new_file.txt</pre>
<p>Aliases: mv</p>
</dd>
<dt><strong><a name="item_open"><strong>open URL</strong></a></strong></dt>

<dd>
<p>connects to the WebDAV-enabled server at URL</p>
<pre>
   dave&gt; open host.org/dav_dir/</pre>
<p>Note that if authorization details are required you will 
be prompted for them.</p>
<p>https and Digest authorization are not currently 
supported. Please let me know if you need it.</p>
</dd>
<dt><strong><a name="item_options__5burl_5d"><strong>options [URL]</strong></a></strong></dt>

<dd>
<p>show the HTTP methods allowed for a URL</p>
<pre>
   dave&gt; options index.html
   OPTIONS, GET, HEAD, POST, DELETE, TRACE, PROPFIND, 
   PROPPATCH, COPY, MOVE, LOCK, UNLOCK</pre>
<p>Note that Microsoft's IIS does not support LOCK on 
collections (directories). Nor does it support PROPPATCH.</p>
</dd>
<dt><strong><a name="item_propfind__5burl_5d"><strong>propfind [URL]</strong></a></strong></dt>

<dd>
<p>show the properties of a resource</p>
<pre>
  dave&gt; propfind test
  URL: <a href="http://host.org/dav_dir/test/">http://host.org/dav_dir/test/</a>
  Content-type: httpd/unix-directory
  Creation date: Wed Aug 29 00:36:42 2001
  Last modified:
  Size:  bytes
  Locks supported: write/exclusive write/shared
  Locks:</pre>
<p>Using ls will get you the same printout if you ls 
a file. But ls'ing a collection will show you the 
collections contents.</p>
</dd>
<dt><strong><a name="item_put_file__5burl_5d"><strong>put FILE [URL]</strong></a></strong></dt>

<dd>
<p>uploads a local file or directory to URL
or the currently opened location.</p>
<p>If URL is an existing collection then the dir/file will
be copied INTO that collection.</p>
<pre>
  dave&gt; open host.org/dav_dir/</pre>
<p>Recursively put local my_dir/ to host.org/dav_dir/my_dir/:</p>
<pre>
  dave&gt; put my_dir/</pre>
<p>Put local index.html to host.org/dav_dir/index1.html:</p>
<pre>
  dave&gt; put /tmp/index.html index1.html</pre>
<p>Put * to remote directory</p>
<pre>
  dave&gt; put *</pre>
<p>Put index[12].htm? to remote directory /dav_dir (/dav_dir must exist)</p>
<pre>
  dave&gt; put index[12].htm? /dav_dir</pre>
<p>Put index[1234].htm? to remote directory /dav_dir (/dav_dir must exist)</p>
<pre>
  dave&gt; put index[1-4].htm? /dav_dir</pre>
<p>Glob types supported are, * (matches any characters), ? (matches any one character), [...] (matches any characters in the set ...).</p>
</dd>
<dt><strong><a name="item_pwd"><strong>pwd</strong></a></strong></dt>

<dd>
<p>prints the currently opened URL (working directory)</p>
<pre>
 dave&gt; open host.org/dav_dir/
 dave&gt; cd new_dir/
 dave&gt; pwd
 <a href="http://host.org/dav_dir/new_dir/">http://host.org/dav_dir/new_dir/</a></pre>
</dd>
<dt><strong><a name="item_q"><strong>q</strong></a></strong></dt>

<dt><strong><a name="item_bye"><strong>bye</strong></a></strong></dt>

<dt><strong><a name="item_quit"><strong>quit</strong></a></strong></dt>

<dd>
<p>exits dave</p>
<p>Note that dave does not unlock any locks created 
during your session.</p>
<p>Aliases: q, quit</p>
</dd>
<dt><strong><a name="item_set_url_property_value__5bnamespace_5d"><strong>set URL PROPERTY VALUE [NAMESPACE]</strong></a></strong></dt>

<dd>
<p>sets a custom property on a resource</p>
<pre>
   dave&gt; set file.txt author &quot;Patrick Collins&quot;
   dave&gt; set file.txt author &quot;Patrick Collins&quot; &quot;mynamespace&quot;</pre>
<p>The NAMESPACE by default is ``DAV:''.</p>
</dd>
<dt><strong><a name="item__21"><strong>!</strong></a></strong></dt>

<dt><strong><a name="item_sh"><strong>sh</strong></a></strong></dt>

<dd>
<p>executes a local command (alias !)</p>
<pre>
   dave&gt; sh cat localfile
   dave&gt; !gzip localfile.gz
   dave&gt; ! &quot;cat localfile | less&quot;</pre>
<p>Aliases: !</p>
</dd>
<dt><strong><a name="item_showlocks"><strong>showlocks</strong></a></strong></dt>

<dd>
<p>show my locks on a resource</p>
<p>Shows any locked resources that you've locked in this 
session.</p>
<p>See <code>propfind</code> if you'd like to see anyone's locks held 
against a particular resource.</p>
</dd>
<dt><strong><a name="item_steal__5burl_5d"><strong>steal [URL]</strong></a></strong></dt>

<dd>
<p>remove ANY locks on a resource</p>
<p>Useful if you accidentally forgot to unlock a resource 
from a previous session or if you think that somebody 
has forgotten to unlock a resource.</p>
</dd>
<dt><strong><a name="item_unlock__5burl_5d"><strong>unlock [URL]</strong></a></strong></dt>

<dd>
<p>unlocks a resource</p>
<p>Note that unlock will only unlock locks that you have 
created. Use steal if you want to forcefully unlock 
somebody else's lock.</p>
</dd>
<dt><strong><a name="item_unset_url_property__5bnamespace_5d"><strong>unset URL PROPERTY [NAMESPACE]</strong></a></strong></dt>

<dd>
<p>unsets a property from a resource</p>
<pre>
   dave&gt; unset file.txt author
   dave&gt; unset file.txt author &quot;mynamespace&quot;</pre>
<p>The NAMESPACE by default is ``DAV:''.</p>
</dd>
</dl>
<p>
</p>
<hr />
<h1><a name="getting_help">GETTING HELP</a></h1>
<p>The perldav mailing list
There is a mailing list for PerlDAV and dave for use by Developers and Users.
Please see <a href="http://mailman.webdav.org/mailman/listinfo/perldav">http://mailman.webdav.org/mailman/listinfo/perldav</a></p>
<p>
</p>
<hr />
<h1><a name="installation">INSTALLATION</a></h1>
<p>dave is installed to /usr/local/bin by default when you 
install the PerlDAV library. See 
<a href="http://www.webdav.org/perldav/">http://www.webdav.org/perldav/</a> for installation details 
of PerlDAV.</p>
<p>
</p>
<hr />
<h1><a name="what_platforms_will_it_work_on">WHAT PLATFORMS WILL IT WORK ON?</a></h1>
<p>dave is pure perl so only needs Perl5.003 (or later) and 
the <code>PerlDAV</code> library to be installed.</p>
<p>I have not ported dave to Windows but would like somebody 
to have a shot at it.</p>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p>The <code>PerlDAV</code> perl API at <a href="http://www.webdav.org/perldav/">http://www.webdav.org/perldav/</a>
or by typing ``perldoc HTTP::DAV'' on your command line.</p>
<p>
</p>
<hr />
<h1><a name="author_and_copyright">AUTHOR AND COPYRIGHT</a></h1>
<p>This module is Copyright (C) 2001 by</p>
<pre>
    Patrick Collins
    G03 Gloucester Place, Kensington
    Sydney, Australia</pre>
<pre>
    Email: pcollins@cpan.org
    Phone: +61 2 9663 4916</pre>
<p>All rights reserved.

</p>
<p>You may distribute this module under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.

</p>

</body>

</html>