Announcement

Collapse
No announcement yet.

Sub Directories

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sub Directories

    Using PB 3.5, Win 98 and running my program in a dos box.

    I'm in a directory, let's say c:\junk and it might have several
    subdirectories such as c:\junk\data1 & c:\junk\data2 & etc
    I want to know if there are any c:\junk subdirectories and
    if there are what are their names.

    I am currently using the SHELL "DIR c:\junk\*. >scratch.txt".
    Take 'scratch.txt' apart and look for directory names.
    It's ok, but it's not nice and clean.

    Any suggested code or point me in the right direction would
    be appreciated.

    Jack Kramer


    ------------------

  • #2
    Try this:
    Code:
    te$ = dir$(*.*,16)  '16 = subdirectories (folders)
    do until te$ = ""
    incr i
    a$(i) = te$
    te$ = dir$
    loop
    This will pickup the 8.3 short file names. PB/DOS can't digest
    LFN's although there is code posted that will allow you to do
    so.

    It's been a while since I used this. I can't remember if this
    also picks up regular files.


    ------------------
    There are no atheists in a fox hole or the morning of a math test.
    If my flag offends you, I'll help you pack.

    Comment


    • #3

      Thanks, works just great and simple too.

      Jack




      ------------------

      Comment

      Working...
      X