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 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="Start" href="index.html">
<link rel="previous" href="Netfs.html">
<link rel="next" href="Netauth.html">
<link rel="Up" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of extensions" rel=Appendix href="index_extensions.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of class attributes" rel=Appendix href="index_attributes.html">
<link title="Index of class methods" rel=Appendix href="index_methods.html">
<link title="Index of classes" rel=Appendix href="index_classes.html">
<link title="Index of class types" rel=Appendix href="index_class_types.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Index of module types" rel=Appendix href="index_module_types.html">
<link title="Uq_gtk" rel="Chapter" href="Uq_gtk.html">
<link title="Uq_tcl" rel="Chapter" href="Uq_tcl.html">
<link title="Equeue" rel="Chapter" href="Equeue.html">
<link title="Unixqueue" rel="Chapter" href="Unixqueue.html">
<link title="Unixqueue_pollset" rel="Chapter" href="Unixqueue_pollset.html">
<link title="Unixqueue_select" rel="Chapter" href="Unixqueue_select.html">
<link title="Uq_resolver" rel="Chapter" href="Uq_resolver.html">
<link title="Uq_engines" rel="Chapter" href="Uq_engines.html">
<link title="Uq_multiplex" rel="Chapter" href="Uq_multiplex.html">
<link title="Uq_transfer" rel="Chapter" href="Uq_transfer.html">
<link title="Uq_socks5" rel="Chapter" href="Uq_socks5.html">
<link title="Uq_io" rel="Chapter" href="Uq_io.html">
<link title="Uq_lwt" rel="Chapter" href="Uq_lwt.html">
<link title="Uq_libevent" rel="Chapter" href="Uq_libevent.html">
<link title="Uq_mt" rel="Chapter" href="Uq_mt.html">
<link title="Uq_client" rel="Chapter" href="Uq_client.html">
<link title="Uq_server" rel="Chapter" href="Uq_server.html">
<link title="Uq_datagram" rel="Chapter" href="Uq_datagram.html">
<link title="Uq_engines_compat" rel="Chapter" href="Uq_engines_compat.html">
<link title="Equeue_intro" rel="Chapter" href="Equeue_intro.html">
<link title="Equeue_howto" rel="Chapter" href="Equeue_howto.html">
<link title="Netcamlbox" rel="Chapter" href="Netcamlbox.html">
<link title="Netcgi_apache" rel="Chapter" href="Netcgi_apache.html">
<link title="Netcgi_modtpl" rel="Chapter" href="Netcgi_modtpl.html">
<link title="Netcgi_plex" rel="Chapter" href="Netcgi_plex.html">
<link title="Netcgi_common" rel="Chapter" href="Netcgi_common.html">
<link title="Netcgi" rel="Chapter" href="Netcgi.html">
<link title="Netcgi_ajp" rel="Chapter" href="Netcgi_ajp.html">
<link title="Netcgi_scgi" rel="Chapter" href="Netcgi_scgi.html">
<link title="Netcgi_cgi" rel="Chapter" href="Netcgi_cgi.html">
<link title="Netcgi_fcgi" rel="Chapter" href="Netcgi_fcgi.html">
<link title="Netcgi_dbi" rel="Chapter" href="Netcgi_dbi.html">
<link title="Netcgi1_compat" rel="Chapter" href="Netcgi1_compat.html">
<link title="Netcgi_test" rel="Chapter" href="Netcgi_test.html">
<link title="Netcgi_porting" rel="Chapter" href="Netcgi_porting.html">
<link title="Nethttp_client_conncache" rel="Chapter" href="Nethttp_client_conncache.html">
<link title="Nethttp_client" rel="Chapter" href="Nethttp_client.html">
<link title="Nettelnet_client" rel="Chapter" href="Nettelnet_client.html">
<link title="Netftp_data_endpoint" rel="Chapter" href="Netftp_data_endpoint.html">
<link title="Netftp_client" rel="Chapter" href="Netftp_client.html">
<link title="Nethttp_fs" rel="Chapter" href="Nethttp_fs.html">
<link title="Netftp_fs" rel="Chapter" href="Netftp_fs.html">
<link title="Netsmtp" rel="Chapter" href="Netsmtp.html">
<link title="Netpop" rel="Chapter" href="Netpop.html">
<link title="Netldap" rel="Chapter" href="Netldap.html">
<link title="Netclient_tut" rel="Chapter" href="Netclient_tut.html">
<link title="Netgss_bindings" rel="Chapter" href="Netgss_bindings.html">
<link title="Netgss" rel="Chapter" href="Netgss.html">
<link title="Nethttpd_types" rel="Chapter" href="Nethttpd_types.html">
<link title="Nethttpd_kernel" rel="Chapter" href="Nethttpd_kernel.html">
<link title="Nethttpd_reactor" rel="Chapter" href="Nethttpd_reactor.html">
<link title="Nethttpd_engine" rel="Chapter" href="Nethttpd_engine.html">
<link title="Nethttpd_services" rel="Chapter" href="Nethttpd_services.html">
<link title="Nethttpd_plex" rel="Chapter" href="Nethttpd_plex.html">
<link title="Nethttpd_util" rel="Chapter" href="Nethttpd_util.html">
<link title="Nethttpd_intro" rel="Chapter" href="Nethttpd_intro.html">
<link title="Netmcore" rel="Chapter" href="Netmcore.html">
<link title="Netmcore_camlbox" rel="Chapter" href="Netmcore_camlbox.html">
<link title="Netmcore_mempool" rel="Chapter" href="Netmcore_mempool.html">
<link title="Netmcore_heap" rel="Chapter" href="Netmcore_heap.html">
<link title="Netmcore_ref" rel="Chapter" href="Netmcore_ref.html">
<link title="Netmcore_array" rel="Chapter" href="Netmcore_array.html">
<link title="Netmcore_sem" rel="Chapter" href="Netmcore_sem.html">
<link title="Netmcore_mutex" rel="Chapter" href="Netmcore_mutex.html">
<link title="Netmcore_condition" rel="Chapter" href="Netmcore_condition.html">
<link title="Netmcore_queue" rel="Chapter" href="Netmcore_queue.html">
<link title="Netmcore_buffer" rel="Chapter" href="Netmcore_buffer.html">
<link title="Netmcore_matrix" rel="Chapter" href="Netmcore_matrix.html">
<link title="Netmcore_hashtbl" rel="Chapter" href="Netmcore_hashtbl.html">
<link title="Netmcore_process" rel="Chapter" href="Netmcore_process.html">
<link title="Netmcore_tut" rel="Chapter" href="Netmcore_tut.html">
<link title="Netmcore_basics" rel="Chapter" href="Netmcore_basics.html">
<link title="Netplex_types" rel="Chapter" href="Netplex_types.html">
<link title="Netplex_mp" rel="Chapter" href="Netplex_mp.html">
<link title="Netplex_mt" rel="Chapter" href="Netplex_mt.html">
<link title="Netplex_log" rel="Chapter" href="Netplex_log.html">
<link title="Netplex_controller" rel="Chapter" href="Netplex_controller.html">
<link title="Netplex_container" rel="Chapter" href="Netplex_container.html">
<link title="Netplex_sockserv" rel="Chapter" href="Netplex_sockserv.html">
<link title="Netplex_workload" rel="Chapter" href="Netplex_workload.html">
<link title="Netplex_main" rel="Chapter" href="Netplex_main.html">
<link title="Netplex_config" rel="Chapter" href="Netplex_config.html">
<link title="Netplex_kit" rel="Chapter" href="Netplex_kit.html">
<link title="Rpc_netplex" rel="Chapter" href="Rpc_netplex.html">
<link title="Netplex_cenv" rel="Chapter" href="Netplex_cenv.html">
<link title="Netplex_semaphore" rel="Chapter" href="Netplex_semaphore.html">
<link title="Netplex_sharedvar" rel="Chapter" href="Netplex_sharedvar.html">
<link title="Netplex_mutex" rel="Chapter" href="Netplex_mutex.html">
<link title="Netplex_encap" rel="Chapter" href="Netplex_encap.html">
<link title="Netplex_mbox" rel="Chapter" href="Netplex_mbox.html">
<link title="Netplex_internal" rel="Chapter" href="Netplex_internal.html">
<link title="Netplex_intro" rel="Chapter" href="Netplex_intro.html">
<link title="Netplex_advanced" rel="Chapter" href="Netplex_advanced.html">
<link title="Netplex_admin" rel="Chapter" href="Netplex_admin.html">
<link title="Netshm" rel="Chapter" href="Netshm.html">
<link title="Netshm_data" rel="Chapter" href="Netshm_data.html">
<link title="Netshm_hashtbl" rel="Chapter" href="Netshm_hashtbl.html">
<link title="Netshm_array" rel="Chapter" href="Netshm_array.html">
<link title="Netshm_intro" rel="Chapter" href="Netshm_intro.html">
<link title="Netstring_pcre" rel="Chapter" href="Netstring_pcre.html">
<link title="Netconversion" rel="Chapter" href="Netconversion.html">
<link title="Netchannels" rel="Chapter" href="Netchannels.html">
<link title="Netstream" rel="Chapter" href="Netstream.html">
<link title="Netmime_string" rel="Chapter" href="Netmime_string.html">
<link title="Netmime" rel="Chapter" href="Netmime.html">
<link title="Netsendmail" rel="Chapter" href="Netsendmail.html">
<link title="Neturl" rel="Chapter" href="Neturl.html">
<link title="Netaddress" rel="Chapter" href="Netaddress.html">
<link title="Netbuffer" rel="Chapter" href="Netbuffer.html">
<link title="Netmime_header" rel="Chapter" href="Netmime_header.html">
<link title="Netmime_channels" rel="Chapter" href="Netmime_channels.html">
<link title="Neturl_ldap" rel="Chapter" href="Neturl_ldap.html">
<link title="Netdate" rel="Chapter" href="Netdate.html">
<link title="Netencoding" rel="Chapter" href="Netencoding.html">
<link title="Netulex" rel="Chapter" href="Netulex.html">
<link title="Netaccel" rel="Chapter" href="Netaccel.html">
<link title="Netaccel_link" rel="Chapter" href="Netaccel_link.html">
<link title="Nethtml" rel="Chapter" href="Nethtml.html">
<link title="Netstring_str" rel="Chapter" href="Netstring_str.html">
<link title="Netmappings" rel="Chapter" href="Netmappings.html">
<link title="Netaux" rel="Chapter" href="Netaux.html">
<link title="Nethttp" rel="Chapter" href="Nethttp.html">
<link title="Netpagebuffer" rel="Chapter" href="Netpagebuffer.html">
<link title="Netfs" rel="Chapter" href="Netfs.html">
<link title="Netglob" rel="Chapter" href="Netglob.html">
<link title="Netauth" rel="Chapter" href="Netauth.html">
<link title="Netsockaddr" rel="Chapter" href="Netsockaddr.html">
<link title="Netnumber" rel="Chapter" href="Netnumber.html">
<link title="Netxdr_mstring" rel="Chapter" href="Netxdr_mstring.html">
<link title="Netxdr" rel="Chapter" href="Netxdr.html">
<link title="Netcompression" rel="Chapter" href="Netcompression.html">
<link title="Netunichar" rel="Chapter" href="Netunichar.html">
<link title="Netasn1" rel="Chapter" href="Netasn1.html">
<link title="Netasn1_encode" rel="Chapter" href="Netasn1_encode.html">
<link title="Netoid" rel="Chapter" href="Netoid.html">
<link title="Netstring_tstring" rel="Chapter" href="Netstring_tstring.html">
<link title="Netdn" rel="Chapter" href="Netdn.html">
<link title="Netx509" rel="Chapter" href="Netx509.html">
<link title="Netascii_armor" rel="Chapter" href="Netascii_armor.html">
<link title="Nettls_support" rel="Chapter" href="Nettls_support.html">
<link title="Netmech_scram" rel="Chapter" href="Netmech_scram.html">
<link title="Netmech_scram_gssapi" rel="Chapter" href="Netmech_scram_gssapi.html">
<link title="Netmech_scram_sasl" rel="Chapter" href="Netmech_scram_sasl.html">
<link title="Netmech_scram_http" rel="Chapter" href="Netmech_scram_http.html">
<link title="Netgssapi_support" rel="Chapter" href="Netgssapi_support.html">
<link title="Netgssapi_auth" rel="Chapter" href="Netgssapi_auth.html">
<link title="Netchannels_crypto" rel="Chapter" href="Netchannels_crypto.html">
<link title="Netx509_pubkey" rel="Chapter" href="Netx509_pubkey.html">
<link title="Netx509_pubkey_crypto" rel="Chapter" href="Netx509_pubkey_crypto.html">
<link title="Netsaslprep" rel="Chapter" href="Netsaslprep.html">
<link title="Netmech_plain_sasl" rel="Chapter" href="Netmech_plain_sasl.html">
<link title="Netmech_crammd5_sasl" rel="Chapter" href="Netmech_crammd5_sasl.html">
<link title="Netmech_digest_sasl" rel="Chapter" href="Netmech_digest_sasl.html">
<link title="Netmech_digest_http" rel="Chapter" href="Netmech_digest_http.html">
<link title="Netmech_krb5_sasl" rel="Chapter" href="Netmech_krb5_sasl.html">
<link title="Netmech_gs2_sasl" rel="Chapter" href="Netmech_gs2_sasl.html">
<link title="Netmech_spnego_http" rel="Chapter" href="Netmech_spnego_http.html">
<link title="Netchannels_tut" rel="Chapter" href="Netchannels_tut.html">
<link title="Netmime_tut" rel="Chapter" href="Netmime_tut.html">
<link title="Netsendmail_tut" rel="Chapter" href="Netsendmail_tut.html">
<link title="Netulex_tut" rel="Chapter" href="Netulex_tut.html">
<link title="Neturl_tut" rel="Chapter" href="Neturl_tut.html">
<link title="Netsys" rel="Chapter" href="Netsys.html">
<link title="Netsys_posix" rel="Chapter" href="Netsys_posix.html">
<link title="Netsys_pollset" rel="Chapter" href="Netsys_pollset.html">
<link title="Netlog" rel="Chapter" href="Netlog.html">
<link title="Netexn" rel="Chapter" href="Netexn.html">
<link title="Netsys_win32" rel="Chapter" href="Netsys_win32.html">
<link title="Netsys_pollset_posix" rel="Chapter" href="Netsys_pollset_posix.html">
<link title="Netsys_pollset_win32" rel="Chapter" href="Netsys_pollset_win32.html">
<link title="Netsys_pollset_generic" rel="Chapter" href="Netsys_pollset_generic.html">
<link title="Netsys_signal" rel="Chapter" href="Netsys_signal.html">
<link title="Netsys_oothr" rel="Chapter" href="Netsys_oothr.html">
<link title="Netsys_xdr" rel="Chapter" href="Netsys_xdr.html">
<link title="Netsys_rng" rel="Chapter" href="Netsys_rng.html">
<link title="Netsys_crypto_types" rel="Chapter" href="Netsys_crypto_types.html">
<link title="Netsys_types" rel="Chapter" href="Netsys_types.html">
<link title="Netsys_mem" rel="Chapter" href="Netsys_mem.html">
<link title="Netsys_tmp" rel="Chapter" href="Netsys_tmp.html">
<link title="Netsys_sem" rel="Chapter" href="Netsys_sem.html">
<link title="Netsys_pmanage" rel="Chapter" href="Netsys_pmanage.html">
<link title="Netsys_crypto" rel="Chapter" href="Netsys_crypto.html">
<link title="Netsys_tls" rel="Chapter" href="Netsys_tls.html">
<link title="Netsys_ciphers" rel="Chapter" href="Netsys_ciphers.html">
<link title="Netsys_digests" rel="Chapter" href="Netsys_digests.html">
<link title="Netsys_crypto_modes" rel="Chapter" href="Netsys_crypto_modes.html">
<link title="Netsys_gssapi" rel="Chapter" href="Netsys_gssapi.html">
<link title="Netsys_sasl_types" rel="Chapter" href="Netsys_sasl_types.html">
<link title="Netsys_sasl" rel="Chapter" href="Netsys_sasl.html">
<link title="Netsys_polypipe" rel="Chapter" href="Netsys_polypipe.html">
<link title="Netsys_polysocket" rel="Chapter" href="Netsys_polysocket.html">
<link title="Netsys_global" rel="Chapter" href="Netsys_global.html">
<link title="Nettls_gnutls_bindings" rel="Chapter" href="Nettls_gnutls_bindings.html">
<link title="Nettls_nettle_bindings" rel="Chapter" href="Nettls_nettle_bindings.html">
<link title="Nettls_gnutls" rel="Chapter" href="Nettls_gnutls.html">
<link title="Netunidata" rel="Chapter" href="Netunidata.html">
<link title="Netgzip" rel="Chapter" href="Netgzip.html">
<link title="Rpc_auth_local" rel="Chapter" href="Rpc_auth_local.html">
<link title="Rpc_xti_client" rel="Chapter" href="Rpc_xti_client.html">
<link title="Rpc" rel="Chapter" href="Rpc.html">
<link title="Rpc_program" rel="Chapter" href="Rpc_program.html">
<link title="Rpc_util" rel="Chapter" href="Rpc_util.html">
<link title="Rpc_portmapper_aux" rel="Chapter" href="Rpc_portmapper_aux.html">
<link title="Rpc_packer" rel="Chapter" href="Rpc_packer.html">
<link title="Rpc_transport" rel="Chapter" href="Rpc_transport.html">
<link title="Rpc_client" rel="Chapter" href="Rpc_client.html">
<link title="Rpc_simple_client" rel="Chapter" href="Rpc_simple_client.html">
<link title="Rpc_portmapper_clnt" rel="Chapter" href="Rpc_portmapper_clnt.html">
<link title="Rpc_portmapper" rel="Chapter" href="Rpc_portmapper.html">
<link title="Rpc_server" rel="Chapter" href="Rpc_server.html">
<link title="Rpc_auth_sys" rel="Chapter" href="Rpc_auth_sys.html">
<link title="Rpc_auth_gssapi" rel="Chapter" href="Rpc_auth_gssapi.html">
<link title="Rpc_proxy" rel="Chapter" href="Rpc_proxy.html">
<link title="Rpc_intro" rel="Chapter" href="Rpc_intro.html">
<link title="Rpc_mapping_ref" rel="Chapter" href="Rpc_mapping_ref.html">
<link title="Rpc_intro_gss" rel="Chapter" href="Rpc_intro_gss.html">
<link title="Shell_sys" rel="Chapter" href="Shell_sys.html">
<link title="Shell" rel="Chapter" href="Shell.html">
<link title="Shell_uq" rel="Chapter" href="Shell_uq.html">
<link title="Shell_fs" rel="Chapter" href="Shell_fs.html">
<link title="Shell_intro" rel="Chapter" href="Shell_intro.html">
<link title="Intro" rel="Chapter" href="Intro.html">
<link title="Platform" rel="Chapter" href="Platform.html">
<link title="Foreword" rel="Chapter" href="Foreword.html">
<link title="Ipv6" rel="Chapter" href="Ipv6.html">
<link title="Regexp" rel="Chapter" href="Regexp.html">
<link title="Tls" rel="Chapter" href="Tls.html">
<link title="Crypto" rel="Chapter" href="Crypto.html">
<link title="Authentication" rel="Chapter" href="Authentication.html">
<link title="Credentials" rel="Chapter" href="Credentials.html">
<link title="Gssapi" rel="Chapter" href="Gssapi.html">
<link title="Ocamlnet4" rel="Chapter" href="Ocamlnet4.html">
<link title="Get" rel="Chapter" href="Get.html"><link title="Types and exceptions" rel="Section" href="#2_Typesandexceptions">
<link title="Parsing and printing" rel="Section" href="#2_Parsingandprinting">
<link title="Operations on valid_glob_expr" rel="Section" href="#2_Operationsonvalidglobexpr">
<link title="Globbing" rel="Section" href="#2_Globbing">
<link title="Remarks" rel="Section" href="#2_Remarks">
<link title="Default access objects" rel="Section" href="#2_Defaultaccessobjects">
<link title="Compatibility" rel="Section" href="#2_Compatibility">
<title>Ocamlnet 4 Reference Manual : Netglob</title>
</head>
<body>
<div class="navbar"><a class="pre" href="Netfs.html" title="Netfs">Previous</a>
<a class="up" href="index.html" title="Index">Up</a>
<a class="post" href="Netauth.html" title="Netauth">Next</a>
</div>
<h1>Module <a href="type_Netglob.html">Netglob</a></h1>
<pre><span id="MODULENetglob"><span class="keyword">module</span> Netglob</span>: <code class="code">sig</code> <a href="Netglob.html">..</a> <code class="code">end</code></pre><div class="info module top">
<div class="info-desc">
<p>Globbing</p>
</div>
</div>
<hr width="100%">
<p>Globbing resolves shell wildcards like "*" and "?". For example,</p>
<pre class="codepre"><code class="code"> let files = Netglob.glob (`String "*.cm[iox]")
</code></pre>
<p>would return all files matching this pattern (e.g. module.cmi,
module.cmo).</p>
<p>The main user function is <a href="Netglob.html#VALglob"><code class="code">Netglob.glob</code></a>. Globbing accesses the
local filesystem by default, but one can also run the globbing
algorithm on any other filesystem, provided the access primitives
of <a href="Netglob.glob_fsys-c.html"><code class="code">Netglob.glob_fsys</code></a> are available.</p>
<h3 id="2_Typesandexceptions">Types and exceptions</h3>
<pre><span id="TYPEglob_expr"><span class="keyword">type</span> <code class="type"></code>glob_expr</span> = <code class="type"><a href="Netglob.html#TYPEglob_expr_atom">glob_expr_atom</a> list</code> </pre>
<pre><span id="TYPEglob_expr_atom"><span class="keyword">type</span> <code class="type"></code>glob_expr_atom</span> = <code class="type">[ `Brace of <a href="Netglob.html#TYPEglob_expr">glob_expr</a> list<br> | `Bracket of bool * <a href="Netglob.html#TYPEglob_set">glob_set</a><br> | `Literal of string<br> | `Qmark<br> | `Star<br> | `Tilde of string ]</code> </pre>
<div class="info ">
<div class="info-desc">
<p>Atoms:</p>
<ul>
<li><code class="code">`Literal s</code>: Matches the string literally. The string must not be empty.
The backslash is not an escape character, but matches the
backslash character.</li>
<li><code class="code">`Star</code>: The "*" operator</li>
<li><code class="code">`Qmark</code>: The "?" operator</li>
<li><code class="code">`Bracket(negated,set)</code>: The <code class="code">[...]</code> operator. The <code class="code">set</code> argument
describes the characters that are matched. The <code class="code">negated</code> argument
is true when the expression is negated (i.e. <code class="code">[^...]</code>). </li>
<li><code class="code">`Brace l</code>: The <code class="code">{e1,e2,...}</code> operator</li>
<li><code class="code">`Tilde t</code>: The <code class="code">~username</code> operator. If <code class="code">t=""</code> the current user
is meant. The <code class="code">`Tilde</code> atom may only occur at the beginning of the list.
The <code class="code">`Tilde</code> atom always matches a directory,
and must be followed by a literal slash (if anything follows).</li>
</ul>
<p>Compatibility: Conforms to POSIX with extensions (braces). Shells often
implement brace expressions in a slightly different way (braces are
parsed and expanded in a separate step before the other pattern
constructors are handled). The cases where this leads to different
results are quite exotic (e.g. <code class="code">"{~g,~h}1"</code> would mean <code class="code">"~g1 ~h1"</code>, but
this implementation rejects the pattern).</p>
</div>
</div>
<pre><span id="TYPEglob_set"><span class="keyword">type</span> <code class="type"></code>glob_set</span> = <</pre><table class="typetable">
<tr>
<td align="left" valign="top" >
<code> </code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTglob_set.set">set</span> : <code class="type">(int * int) list</code>;</code></td>
</tr></table>
>
</pre>
<div class="info ">
<div class="info-desc">
<p>A set of code points is given as a list of ranges <code class="code">(from,to)</code>, with
<code class="code">from <= to</code>. It is allowed that ranges overlap.</p>
</div>
</div>
<pre><span id="TYPEvalid_glob_expr"><span class="keyword">type</span> <code class="type"></code>valid_glob_expr</span> </pre>
<div class="info ">
<div class="info-desc">
<p>A validated <code class="code">glob_expr</code></p>
</div>
</div>
<pre><span id="TYPEuser_info"><span class="keyword">class type</span> <a href="Netglob.user_info-c.html">user_info</a></span> = <code class="code">object</code> <a href="Netglob.user_info-c.html">..</a> <code class="code">end</code></pre><div class="info">
<p>Access to the user database</p>
</div>
<pre><span id="TYPEglob_fsys"><span class="keyword">class type</span> <a href="Netglob.glob_fsys-c.html">glob_fsys</a></span> = <code class="code">object</code> <a href="Netglob.glob_fsys-c.html">..</a> <code class="code">end</code></pre><div class="info">
<p>Filesystem primitives.</p>
</div>
<pre><span id="TYPEglob_mode"><span class="keyword">type</span> <code class="type"></code>glob_mode</span> = <code class="type">[ `All_paths | `All_words | `Existing_paths ]</code> </pre>
<div class="info ">
<div class="info-desc">
<p>Modes:</p>
<ul>
<li><code class="code">`Existing_paths</code>: Only paths are returned that really exist</li>
<li><code class="code">`All_paths</code>: Generated paths not including <code class="code">*</code>, <code class="code">?</code> and
bracket expressions are returned even if they do not exist.
For example, globbing for <code class="code">"fictive{1,2,3}"</code> would return
<code class="code">["ficitve1";"fictive2";"fictive3"]</code> independent of whether
these files exist.</li>
<li><code class="code">`All_words</code>: Patterns that cannot be resolved are returned
as-is (like the shell does)</li>
</ul>
</div>
</div>
<pre><span id="TYPEpattern"><span class="keyword">type</span> <code class="type"></code>pattern</span> = <code class="type">[ `Expr of <a href="Netglob.html#TYPEvalid_glob_expr">valid_glob_expr</a> | `String of string ]</code> </pre>
<div class="info ">
<div class="info-desc">
<p>Input for <a href="Netglob.html#VALglob"><code class="code">Netglob.glob</code></a></p>
</div>
</div>
<pre><span id="EXCEPTIONBad_glob_expr"><span class="keyword">exception</span> Bad_glob_expr</span> <span class="keyword">of</span> <code class="type">string</code></pre>
<div class="info ">
<div class="info-desc">
<p>An syntax error in the glob expression; the argument is the bad
expression</p>
</div>
</div>
<pre><span id="EXCEPTIONUnsupported_expr"><span class="keyword">exception</span> Unsupported_expr</span> <span class="keyword">of</span> <code class="type">string</code></pre>
<div class="info ">
<div class="info-desc">
<p>The notations <code class="code">:class:</code>, <code class="code">.symbol.</code>, <code class="code">=eqclass=</code> inside <code class="code">...</code> are
not supported by this implementation. If they are found, this exception
will be raised, and the argument is the whole glob expression</p>
</div>
</div>
<h3 id="2_Parsingandprinting">Parsing and printing</h3>
<pre><span id="VALparse_glob_expr"><span class="keyword">val</span> parse_glob_expr</span> : <code class="type">?encoding:<a href="Netconversion.html#TYPEencoding">Netconversion.encoding</a> -><br> ?enable_star:bool -><br> ?enable_qmark:bool -><br> ?enable_brackets:bool -><br> ?enable_braces:bool -><br> ?enable_tilde:bool -><br> ?enable_escape:bool -> string -> <a href="Netglob.html#TYPEvalid_glob_expr">valid_glob_expr</a></code></pre><div class="info ">
<div class="info-desc">
<p>Parses the glob expression. By default, all syntax features are enabled.
May raise <code class="code">Bad_glob_expr</code> or <code class="code">Unsupported_expr</code>.</p>
<p>The glob expressions are POSIX-compliant with the extension of
brace expressions, and tildes, and the omission of internationalized
bracket expressions:</p>
<ul>
<li><code class="code">*</code>: Matches a sequence of zero or more arbitrary characters</li>
<li><code class="code">?</code>: Matches one arbitrary character</li>
<li><code class="code">[abc]</code>: Matches one of the mentioned characters</li>
<li><code class="code">[a-z]</code>: Matches one of the characters of the range. This is here
only permitted when the range falls into the ASCII set. (Otherwise
the interpretation would be dependent on the encoding.) Note that
the ASCII restriction does not comply to POSIX.</li>
<li><code class="code">[!expr]</code> or <code class="code">[^expr]</code>: Negates the bracket expression</li>
<li><code class="code">{expr,expr,...}</code>: Generates a string for each of the alternatives.
A brace expression is even recognized if there is no comma, or even
no contents (i.e. <code class="code">"{expr}"</code> and <code class="code">"{}"</code>). The elements of brace expressions
may be again glob expressions; nested brace expressions are allowed.</li>
<li><code class="code">~username</code>: Generates the home directory of this user</li>
<li><code class="code">~</code>: Generates the home directory of the current user</li>
<li>If enabled, the backslash character is the escape character. Within
bracket expressions, the backslash character never escapes.</li>
<li>Not supported: Collating symbols <code class="code">[.a.]</code>, equivalence classes
<code class="code">[=a=]</code>, and character classes <code class="code">[:name:]</code>. If they are found, the
exception <code class="code">Unsupported_expr</code> will be raised.</li>
</ul>
<p>Glob expressions have a character <code class="code">encoding</code>. This defaults to
<code class="code">`Enc_iso88591</code>. Encodings must be ASCII-compatible.</p>
</div>
</div>
<pre><span id="VALvalidate_glob_expr"><span class="keyword">val</span> validate_glob_expr</span> : <code class="type"><a href="Netconversion.html#TYPEencoding">Netconversion.encoding</a> -> <a href="Netglob.html#TYPEglob_expr">glob_expr</a> -> <a href="Netglob.html#TYPEvalid_glob_expr">valid_glob_expr</a></code></pre><div class="info ">
<div class="info-desc">
<p>Checks whether the passed expression is syntactically valid. If so,
a validated expression is returned. Otherwise, this function fails.</p>
</div>
</div>
<pre><span id="VALrecover_glob_expr"><span class="keyword">val</span> recover_glob_expr</span> : <code class="type"><a href="Netglob.html#TYPEvalid_glob_expr">valid_glob_expr</a> -> <a href="Netglob.html#TYPEglob_expr">glob_expr</a></code></pre><div class="info ">
<div class="info-desc">
<p>Returns the explicit representation</p>
</div>
</div>
<pre><span id="VALencoding_of_glob_expr"><span class="keyword">val</span> encoding_of_glob_expr</span> : <code class="type"><a href="Netglob.html#TYPEvalid_glob_expr">valid_glob_expr</a> -> <a href="Netconversion.html#TYPEencoding">Netconversion.encoding</a></code></pre><div class="info ">
<div class="info-desc">
<p>Returns the encoding</p>
</div>
</div>
<pre><span id="VALliteral_glob_expr"><span class="keyword">val</span> literal_glob_expr</span> : <code class="type"><a href="Netconversion.html#TYPEencoding">Netconversion.encoding</a> -> string -> <a href="Netglob.html#TYPEvalid_glob_expr">valid_glob_expr</a></code></pre><div class="info ">
<div class="info-desc">
<p>Returns an expression that matches literally the passed string</p>
</div>
</div>
<pre><span id="VALprint_glob_expr"><span class="keyword">val</span> print_glob_expr</span> : <code class="type">?escape_in_literals:bool -> <a href="Netglob.html#TYPEvalid_glob_expr">valid_glob_expr</a> -> string</code></pre><div class="info ">
<div class="info-desc">
<p>Prints the glob expression as string. Meta characters are
escaped by a backslash when possible. Meta characters are:
<code class="code">"*"</code>, <code class="code">"?"</code>, <code class="code">"["], ["]"</code>, <code class="code">"{"</code>, <code class="code">"}"</code>, <code class="code">","</code>, <code class="code">"~"</code> and <code class="code">"\\"</code></p>
<ul>
<li><code class="code">escape_in_literals</code>: Whether meta characters in <code class="code">`Literal</code>
subexpressions are escaped. This is true by default.</li>
</ul>
</div>
</div>
<h3 id="2_Operationsonvalidglobexpr">Operations on <code class="code">valid_glob_expr</code></h3>
<pre><span id="VALexpand_glob_expr"><span class="keyword">val</span> expand_glob_expr</span> : <code class="type">?user_info:<a href="Netglob.user_info-c.html">user_info</a> -><br> ?expand_brace:bool -><br> ?expand_tilde:bool -> <a href="Netglob.html#TYPEvalid_glob_expr">valid_glob_expr</a> -> <a href="Netglob.html#TYPEvalid_glob_expr">valid_glob_expr</a> list</code></pre><div class="info ">
<div class="info-desc">
<p>Resolve generative sub expressions by expanding them. The returned
list of glob expr no longer contains the expanded constructions.</p>
<ul>
<li><code class="code">expand_brace</code>: Expands <code class="code">`Brace</code> subexpressions.</li>
<li><code class="code">expand_tilde</code>: Expands <code class="code">`Tilde</code> subexpressions.</li>
<li><code class="code">user_info</code>: The subset of file system operations needed for tilde
expansion. Defaults to <a href="Netglob.html#VALlocal_user_info"><code class="code">Netglob.local_user_info</code></a> (see below).</li>
</ul>
<p>Both <code class="code">expand_*</code> options are enabled by default.</p>
</div>
</div>
<pre><span id="VALmatch_glob_expr"><span class="keyword">val</span> match_glob_expr</span> : <code class="type">?protect_period:bool -><br> ?protect_slash:bool -><br> ?encoding:<a href="Netconversion.html#TYPEencoding">Netconversion.encoding</a> -> <a href="Netglob.html#TYPEvalid_glob_expr">valid_glob_expr</a> -> string -> bool</code></pre><div class="info ">
<div class="info-desc">
<p>Matches the glob_expr against a string.</p>
<p>The input must neither contain brace expressions nor tildes (i.e. call
<code class="code">expand_glob_expr</code> first). The function fails if it encounters such an
expression.</p>
<ul>
<li><code class="code">protect_period</code>: If true, a leading period cannot be not matched by
<code class="code">*</code>, <code class="code">?</code>, <code class="code">[...]</code>, but only by a literal <code class="code">.</code>. A leading period is
a <code class="code">.</code> at the beginning of the string to be matched against, or
if also <code class="code">protect_slash</code> a <code class="code">.</code> after a <code class="code">/</code></li>
<li><code class="code">protect_slash</code>: If true, a slash cannot be matched by <code class="code">*</code>, <code class="code">?</code>, <code class="code">[...]</code>,
but only by a literal <code class="code">/</code></li>
</ul>
<p>Both options are enabled by default.</p>
<ul>
<li><code class="code">encoding</code>: The encoding of the string argument. Defaults to the
encoding of the glob pattern.</li>
</ul>
</div>
</div>
<pre><span id="VALsplit_glob_expr"><span class="keyword">val</span> split_glob_expr</span> : <code class="type"><a href="Netglob.html#TYPEvalid_glob_expr">valid_glob_expr</a> -> <a href="Netglob.html#TYPEvalid_glob_expr">valid_glob_expr</a> list</code></pre><div class="info ">
<div class="info-desc">
<p>Splits the glob expression into filename components separated by
literal <code class="code">/</code> characters. For example, for the glob expression
<code class="code">"a*b/c/d?"</code>, the list <code class="code">["a*b"; "c"; "d?"]</code> is returned.</p>
<p>If the first component begins with a slash, the slash is not removed
from the first returned list element, e.g. for <code class="code">"/ab/c*"</code>, the list
<code class="code">[ "/ab"; "c*" ]</code> is computed. Use <code class="code">check_rooted_glob_expr</code> to test this
case.</p>
<p>Several adjacent slashes are handled like a single slash. E.g.
for <code class="code">"a//b"</code>, the list <code class="code">["a"; "b"]</code> is returned.</p>
<p>If the last component ends with a slash, it is not removed from the
returned list element, e.g. for <code class="code">"a/b/"</code>, the list <code class="code">[ "a"; "b/" ]</code> is
returned. Use <code class="code">check_directory_glob_expr</code> to test this case.</p>
<p>The glob expression passed to this function must not contain brace
or tilde expressions.</p>
</div>
</div>
<pre><span id="VALcheck_rooted_glob_expr"><span class="keyword">val</span> check_rooted_glob_expr</span> : <code class="type"><a href="Netglob.html#TYPEvalid_glob_expr">valid_glob_expr</a> -> <a href="Netglob.html#TYPEvalid_glob_expr">valid_glob_expr</a> option</code></pre><div class="info ">
<div class="info-desc">
<p>If the glob expression matches the root directory (i.e. the expression
begins with a literal <code class="code">/</code>), the function returns <code class="code">Some expr'</code>, where
<code class="code">expr'</code> matches the path relative to the root directory (i.e. the
expression without the <code class="code">/</code> at the beginning).</p>
<p>Otherwise, <code class="code">None</code> is returned.</p>
<p>Example: For <code class="code">"/a/b*"</code>, the expression <code class="code">"a/b*"</code> is returned.</p>
<p>Special case: for <code class="code">"/"</code>, the expression <code class="code">""</code> (only matching the empty
string) is returned.</p>
<p>The glob expression passed to this function must not contain brace
or tilde expressions.</p>
</div>
</div>
<pre><span id="VALcheck_directory_glob_expr"><span class="keyword">val</span> check_directory_glob_expr</span> : <code class="type"><a href="Netglob.html#TYPEvalid_glob_expr">valid_glob_expr</a> -> <a href="Netglob.html#TYPEvalid_glob_expr">valid_glob_expr</a> option</code></pre><div class="info ">
<div class="info-desc">
<p>If the last component of the glob expression matches only directories
because it ends with a literal <code class="code">/</code> character, the value <code class="code">Some expr'</code> is
returned where <code class="code">expr'</code> matches the same path without the trailing <code class="code">/</code>.</p>
<p>Otherwise, <code class="code">None</code> is returned.</p>
<p>Example: For <code class="code">"a/b*/"</code>, the expression <code class="code">"a/b*"</code> is returned.</p>
<p>Special case: for <code class="code">"/"</code>, the expression <code class="code">""</code> (only matching the empty
string) is returned.</p>
<p>The glob expression passed to this function must not contain brace
or tilde expressions.</p>
</div>
</div>
<h3 id="2_Globbing">Globbing</h3>
<pre><span id="VALglob"><span class="keyword">val</span> glob</span> : <code class="type">?encoding:<a href="Netconversion.html#TYPEencoding">Netconversion.encoding</a> -><br> ?base_dir:string -><br> ?protect_period:bool -><br> ?fsys:<a href="Netglob.glob_fsys-c.html">glob_fsys</a> -><br> ?user_info:<a href="Netglob.user_info-c.html">user_info</a> -><br> ?mode:<a href="Netglob.html#TYPEglob_mode">glob_mode</a> -> <a href="Netglob.html#TYPEpattern">pattern</a> -> string list</code></pre><div class="info ">
<div class="info-desc">
<p>Forms a set of filenames as described below, and matches this set
against the pattern. The pattern can be given as a <code class="code">`String s</code>
in which case <code class="code">s</code> is parsed (with all features enabled, and
it is assumed it has the passed <code class="code">encoding</code>). Alternatively,
an already parsed <code class="code">`Expr e</code> can be given. (Note that <code class="code">encoding</code>
is ignored in this case.)</p>
<p><b>Slashes must be explicitly matched:</b>
"/" must literally occur in order to be a candidate for matching.
It is not matched by <code class="code">*</code> or <code class="code">?</code> or a bracket expression.</p>
<p><b>Periods:</b> The leading period is protected if <code class="code">protect_period</code>.
It must then also literally occur to be matched.</p>
<p><b>Anchoring:</b> If the <code class="code">glob_expr</code> begins with a literal "/", the set
of filenames is
anchored at the root directory; otherwise the set is anchored at
the current directory or, if <code class="code">base_dir</code> is passed, at this directory.
(If <code class="code">fsys</code> is passed, it is required to also set <code class="code">base_dir</code>.)</p>
<p>Initially, the set contains all files of the anchor
directory (for the root directory, a "/" is prepended).</p>
<p>After that, the set is extended by adding the paths of
subdirectories relative to the anchor directory. Note that the
constructed set is always infinite, because "." and ".." are not
handled specially, and are also regarded as "subdirectories". However,
after applying the matching criterion, the returned list is always
finite.</p>
<p>Note that the anchor directory itself is not part of the generated
set. For example, for the expression "/*" the root directory "/" is
not returned. As an exception of this rule, for the glob expression
"/" the file "/" is returned.</p>
<p><b>Braces:</b> Brace expressions are handled by expanding them first, even
before filename generation starts.</p>
<p><b>Mode:</b> By default, only existing paths are returned
(<code class="code">mode=`Existing_paths</code>).
If no files match, the empty list is returned (and not the pattern
as the shell does). By passing a different <code class="code">mode</code>, this can be changed:</p>
<ul>
<li><code class="code">`All_paths</code>: It is allowed that non-existing paths
are returned when the paths do not contain *, ?, or [
metacharacters after the brace expansion. Path expressions
with these metacharacters are still checked for existence.</li>
<li><code class="code">`All_words</code>: When an expression does not refer to existing
paths, it is returned as such, leaving the metacharacters *, ?, [
unexpanded (i.e., what the Bourne shell does). Note that
either all metacharacters are resolved, or none, but not
a subset of them.</li>
</ul>
<p><b>Encodings:</b> Often, only the pattern has an encoding, but not
the filesystem (as in Unix). In this case, no conversion is attempted,
and the byte representation of the pattern is matched with the
byte representation of the filenames. Good luck.</p>
<p>If the filesystem has an encoding, however, conversions may
be required, and this can cause problems. Usually, network filesystems
provide an encoding, and the Win32 local filesystem. (For Unix,
one can pass a custom <code class="code">fsys</code> with encoding knowledge.) Conversion
problems can be avoided if (1) the encoding of the pattern is a superset
of the filename encoding. Also, (2) one should not use literals
in the pattern that cannot be represented in the filename encoding.
If (2) cannot be satisfied, ensure you have at least
<code class="code">mode=`Existing_paths</code>, i.e. the default mode (this removes results
from the returned list when a conversion problem occurs).</p>
<p>The return value of <code class="code">glob</code> is encoded in the encoding of the filesystem
if the filesystem provides an encoding. (If you want to check this
encoding, pass <code class="code">fsys</code>, e.g. as <code class="code">local_fsys()</code>, and call the
<code class="code">path_encoding</code> method of <code class="code">fsys</code>.)</p>
</div>
</div>
<h3 id="2_Remarks">Remarks</h3><p><b>Examples demonstrating the effect of encodings:</b> (Linux)</p>
<pre class="codepre"><code class="code"> let fsys = local_fsys ~encoding:`Enc_utf8()
let l = glob ~fsys (`String "\214*")
</code></pre>
<p>The byte 214 is O-umlaut in ISO-8859-1 (the default encoding for
patterns). By passing an <code class="code">fsys</code> argument we change the encoding
for filenames to UTF-8. For example, if</p>
<p>"\195\150ffentlich"</p>
<p>was a file in the current directory, it would be found and
returned in <code class="code">l</code>.</p>
<p>Conversions: For example, assume we have a file
"\226\130\172uro" (EUR-uro in UTF-8). The glob</p>
<pre class="codepre"><code class="code"> let fsys = local_fsys ~encoding:`Enc_utf8()
let l = glob ~fsys (`String "*")
</code></pre>
<p>finds it although the euro sign cannot be represented
in ISO-8859-1, the default pattern encoding.</p>
<p>We run into a problem, however, if we want to generate the
euro sign even if the file is not present, and the filesystem
uses an encoding that does not include this sign:</p>
<pre class="codepre"><code class="code"> let fsys = local_fsys ~encoding:`Enc_iso88591()
let l = glob ~fsys ~encoding:`Enc_utf8 ~mode:`All_paths
(`String "\226\130\172uro")
</code></pre>
<p>This raises an exception <code class="code">Netconversion.Cannot_represent 8364</code>.</p>
<p><b>Notes for Win32:</b></p>
<ul>
<li>Globbing only supports forward slashes, not backslashes as path
separators</li>
<li>Globbing does neither recognize drive letters nor UNC
paths as special cases. This may lead to subtle bugs. Glob
expressions like "c:/file.*" may or may not work depending on the
context.</li>
<li>The usually case-insensitive file system is not taken into account.
(To be fixed.)</li>
</ul>
<h3 id="2_Defaultaccessobjects">Default access objects</h3>
<pre><span id="TYPElocal_user_info"><span class="keyword">class</span> <a href="Netglob.local_user_info-c.html">local_user_info</a></span> : <code class="type">unit -> </code><code class="type"><a href="Netglob.user_info-c.html">user_info</a></code></pre>
<pre><span id="VALlocal_user_info"><span class="keyword">val</span> local_user_info</span> : <code class="type">unit -> <a href="Netglob.user_info-c.html">user_info</a></code></pre><div class="info ">
<div class="info-desc">
<p>Get the home directory of a user from the local user database.</p>
</div>
</div>
<pre><span id="TYPElocal_fsys"><span class="keyword">class</span> <a href="Netglob.local_fsys-c.html">local_fsys</a></span> : <code class="type">?encoding:<a href="Netconversion.html#TYPEencoding">Netconversion.encoding</a> -> unit -> </code><code class="type"><a href="Netglob.glob_fsys-c.html">glob_fsys</a></code></pre>
<pre><span id="VALlocal_fsys"><span class="keyword">val</span> local_fsys</span> : <code class="type">?encoding:<a href="Netconversion.html#TYPEencoding">Netconversion.encoding</a> -> unit -> <a href="Netglob.glob_fsys-c.html">glob_fsys</a></code></pre><div class="info ">
<div class="info-desc">
<p>Accesses the local filesystem</p>
</div>
</div>
<pre><span id="TYPEof_stream_fs"><span class="keyword">class</span> <a href="Netglob.of_stream_fs-c.html">of_stream_fs</a></span> : <code class="type">#<a href="Netfs.stream_fs-c.html">Netfs.stream_fs</a> -> </code><code class="type"><a href="Netglob.glob_fsys-c.html">glob_fsys</a></code></pre>
<pre><span id="VALof_stream_fs"><span class="keyword">val</span> of_stream_fs</span> : <code class="type">#<a href="Netfs.stream_fs-c.html">Netfs.stream_fs</a> -> <a href="Netglob.glob_fsys-c.html">glob_fsys</a></code></pre><div class="info ">
<div class="info-desc">
<p>Use an arbitrary network filesystem for globbing</p>
</div>
</div>
<h3 id="2_Compatibility">Compatibility</h3>
<p>This implementation is not fully compatible with the POSIX specs.
The differences:</p>
<ul>
<li>Missing support for character classes, equivalence classes and
collating symbols.</li>
<li>Ranges in brackets are restricted to ASCII.</li>
<li>Unparseable patterns are indicated by exceptions. POSIX, however,
requires that such patterns are taken literally. E.g. a pattern "["
would match a left bracket in POSIX, but this module throws a
syntax error.</li>
<li>If the slash character is protected, it is still allowed inside
brackets. POSIX, however, requires that the pattern is scanned
for slashes before brackets. For instance, the pattern "[a/b*]"
is scanned as <code class="code"> [`Literal "[a/b]"; `Star] </code> following the POSIX
rules while this implementation sees a bracket expression with
"a", "b", "/" and "*" characters.</li>
<li>The "^" character negates the set if used at the beginning of
bracket expressions. POSIX leaves this unspecified.</li>
<li>Brace expresions are an extension (although commonly implemented
in shells).</li>
<li>The default globbing mode is <code class="code">`Existing_paths</code> which is not
defined by POSIX. Use <code class="code">`All_paths</code> for getting POSIX behavior.</li>
</ul>
<p>Compared with popular shells, there are some subtle differences in
how the various syntax elements (wildcards, braces, tildes) are
parsed and processed. Shells do it in this order:</p>
<ul>
<li>Parse and expand brace expressions</li>
<li>Parse and expand tildes</li>
<li>Split the paths at slashes into path components</li>
<li>Parse and expand wildcards</li>
</ul>
<p>For example, after expanding braces it is possible to see totally
new tilde or wildcard expressions, e.g. <code class="code">"~user{1,2}/file"</code> would
be legal. This implementation here does not support this - we first
parse the expression, and then interpret it. However, users interested in
a higher degree of compatibility can call the <a href="Netglob.html"><code class="code">Netglob</code></a> parsing,
processing and printing functions in the required order, and emulate
the shell behavior. For example,</p>
<pre class="codepre"><code class="code"> let alt_glob pat =
let g1 =
parse_glob_expr
~enable_star:false ~enable_qmark:false ~enable_brackets:false
~enable_tilde:false (* only braces remain enabled *)
pat in
let g2_list =
expand_glob_expr g1 in
let pat2_list =
List.map (print_glob_expr ~escape_in_literals:false) g2_list in
let g3_list =
List.map
(fun pat2 -> parse_glob_expr ~enable_braces:false pat2)
pat2_list in
List.flatten
(List.map (fun g3 -> glob (`Expr g3)) g3_list)
</code></pre>
<p>would parse and expand brace expressions in a separate step before
running <code class="code">glob</code> on the remaining syntactic elements.</p>
</body></html>
|