Subversion Repositories SvarDOS

Rev

Rev 2019 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2019 mateusz.vi 1
pdTree v1.04
2
It is released US public domain.  [note: may use LGPL Cats]
3
Run tree with /? for help in using tree.
4
 
5
Usage: TREE [/A] [/F] [path]
6
/A  - use ASCII (7bit) characters for graphics (lines)
7
/F  - show files
8
path indicates which directory to start display from, default is current.
9
 
10
Note: The following nonstandard options are not documented
11
      with the /? switch.
12
/V  - show version information,
13
/S  - force ShortFileNames (SFNs, disable LFN support)
14
/P  - pause after each page
15
/DF - display filesizes
16
/DA - display attributes (Hidden,System,Readonly,Archive)
17
/DH - display hidden and system files (normally not shown)
18
/DS - display alternate data streams when exist (Win32 only)
19
/U  - use Unicode (UTF-8) characters [Experimental, see usage notes in tree.htm]
20
 
21
TODO:
22
/On - sort* output, where n is F (filesize), N (name), E (extension)
23
* Output is sorted provided enough memory is available, otherwise output is
24
  unsorted to avoid aborting due to out of memory errors.
25
 
26
This version is written with the following goals:
27
  Internationalization, at least support for messages in other languages.
28
  Long File Name support if available.
29
  Nearly identical to Win32 version of tree [NT 4 as basis, 98 lacks tree].
30
  Support for directories with more than 32000 entries. [Yes I've seen this]
31
  Provide compatibility with FreeDOS tree, so compatible replacement (/Dx options).
32
  Provide useful enhancements, built in pause (/P), file details (/Dx options),
33
  sorted* output, and GUI usable output (/U).
34
 
35
 
36
This version has a set of hard coded messages.  The messages are
37
  separated from the code, so they may easily be changed and tree recompiled.
38
  Additionally, optional support for catgets is included, for easier
39
  changes without recompiling (except to indicate use of catgets).
40
  To use the cats message catalogs, the NLSPATH and LANG environment variables
41
  should be set.  NLSPATH should point to the directory containing the
42
  message catalogs (files) and LANG should be set to the proper language
43
  abbreviation.  E.g set NLSPATH=.  set LANG=EN  will result in tree.en
44
  being using if it is in the current directory, followed by set LANG=ES
45
  will result in tree.es (the Spanish version) being used.
46
  When compiled under Windows or DOS with catgets it uses the LGPL
47
  (refer to LGPL.txt) cats library written by Jim Hall, cats38s.zip.
48
    Cats, Copyright (C) 1999,2000 Jim Hall <jhall@freedos.org>
49
    FreeDOS internationalization library
50
    An implementation of UNIX catgets( ) for DOS
51
  Note: The necessary files from cats38s.zip are included along with
52
        the license file, however the full archive should also be
53
        available at the same location this archive was downloaded from.
54
        See files.lst for a list of which files are part of Jim Hall's
55
        cats implementation and thus not public domain.  
56
  Version 3.8 (unmodified) is the current version of Jim Hall's cats used.
57
 
58
Since I wanted lfn support, I choose the win32 versions of
59
  findfirst, findnext, findclose as the basis for my routines
60
  that implement support for lfns.  This allowed me to write tree
61
  first under windows and test for compatibility with the win32 tree.
62
  This version should compile under Windows (copyright Microsoft) console mode
63
  using only the tree.cpp and stack.c files.  To compile under DOS, a 
64
  second file w32fDOS.cpp is needed, which implements the
65
  findfirst/next/close routines and any extra routines.
66
 
67
This version (win32 tree.exe and DOS tree.exe [stub]) as best as I
68
  can tell produces nearly identical output to the WinNT 4 tree program 
69
  except:
70
  The volume only includes the 0000:0000 serial number, as I do not know
71
  where NT's tree is getting the other 8digit number from. 00000000 0000:0000
72
  (other than it is machine and not volume specific).
73
  And my program makes no attempt to display the expanded filepath,
74
  ie changing D:. to D:\somedir\somesubdir
75
  The error level matches that of the [IBM's] PC DOS 7r1 tree.exe;
76
  This implementation sets the error level (return value) consistant 
77
  with the tree program distributed with (copyright) IBM PC DOS 7R1, 
78
  i.e. 0 on successful display and 1 on most errors (critical errors 
79
  such as ctrl-C return unspecified values) and if an option is given 
80
  on the command line (outside of a path to begin at).  Additionally 
81
  the text displayed on error may show different paths (NT2000pro 
82
  displays full current path + bad path, followed by error with full 
83
  path, whereas this implementation shows error with bad path unmodified).
84
  The only differences I have seen between this version and the WinNT 5
85
  (aka Windows 2000 Pro.) version are the same as with the WinNT 4 tree,
86
  and WinNT 5 refers to directories as folders. (This can be changed,
87
  by editing the tree catalog file if really desired.)
88
 
89
It may be somewhat slower than other implementations, because it must
90
  open a directory twice, once to get a count of subdirectories and
91
  then again to actually display information.  The only known
92
  limitations are on filename length (limited by OS mostly), and the
93
  maximum depth limited by available memory (a linked list is used to
94
  store subdirectory information).  Other than slower, it should work 
95
  (though not tested) with directories with more than 32000 files. 
96
  (Note w98 explorer will die if you try to 'select all' on that many 
97
  files. :)
98
 
99
pdTree v1.04
100
Original location: http://www.darklogic.org/fdos/tree/
101
 
102
  Written by: Kenneth J. Davis
103
  Date:       August, 2000
104
  Updated:    September, 2000; October, 2000; November, 2000; January, 2001;
105
              May, 2004; Sept, 2005
106
  Contact:    jeremyd@computer.org
107
 
108
 
109
Copyright (c): Public Domain [United States Definition]
110
[Note: may use LGPL cats by Jim Hall jhall@freedos.org]
111
 
112
Permission is hereby granted, free of charge, to any person obtaining a copy
113
of this software and associated documentation files (the "Software"), to deal
114
in the Software without restriction, including without limitation the rights
115
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
116
copies of the Software, and to permit persons to whom the Software is
117
furnished to do so, subject to the following conditions:
118
 
119
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
120
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
121
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
122
NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR AUTHORS BE
123
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
124
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
125
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
126
DEALINGS IN THE SOFTWARE.