I decided to fiddle around a bit and see what I could do with KiXtart that looks sorta like dir /w ...

What I found is that KiXtart uses long file names, so the formatting is a bit tricky. Also, I didn't worry about sorting the names in alphabetical order, although it probably wouldn't be TOO difficult. If anyone would like to improve on this, go for it!

code:
break on
DIM $files[255]
$x=0
$y=0
$length = 0
$folder = "c:\"
$endfile = "C:\test.txt"

$files[$x] = DIR($folder)

While @error = 0
$x = $x + 1
$files[$x] = DIR()
$folderfile = $folder + $files[$x]
Loop

For each $file in $files
If $file <> ""
$y=$y+1
Endif
Next

REDIM PRESERVE $files[$y-1]

;Print Output

$length = 0
$lengtht = 0
DEL $endfile
$rc = RedirectOutput($endfile)

For each $file in $files

If GetFileAttr($folder + $file) & 16
$file = "[" + $file + "]"
Endif

While LEN($file) < 16
$file = $file + " "
Loop

While LEN($file) > 16 and LEN($file) < 32
$file = $file + " "
Loop

While LEN($file) > 32 and LEN($file) < 48
$file = $file + " "
Loop
While LEN($file) > 48 and LEN($file) < 64
$file = $file + " "
Loop


$length = $length + LEN($file)
;$lengtht = $lengtht + LEN($file)

if $length > 64 and $length < 80
?
$length = 0
Endif

;If $lengtht > 1840
; Get $_
; $lengtht = 0
;Endif

$file

Next
$rc=RedirectOutput("")

{edit}
This worked on a Windows 95 machine, but doesn't seem to work on NT.. at least not so far as the formatting is concerned. I believe this shouldn't be too hard to fix. Also, the array can be resized to accomodate larger directories.


Brian

[ 30 May 2002, 18:20: Message edited by: BrianTX ]