Announcement

Collapse

Forum etiquette

Our mission ...

This forum is part of our mission to promote the preservation of vintage computers through education and outreach. (In real life we also run events and have a museum.) We encourage you to join us, participate, share your knowledge, and enjoy.

This forum has been around in this format for over 15 years. These rules and guidelines help us maintain a healthy and active community, and we moderate the forum to keep things on track. Please familiarize yourself with these rules and guidelines.


Remain civil and respectful

There are several hundred people who actively participate here. People come from all different backgrounds and will have different ways of seeing things. You will not agree with everything you read here. Back-and-forth discussions are fine but do not cross the line into rude or disrespectful behavior.

Conduct yourself as you would at any other place where people come together in person to discuss their hobby. If you wouldn't say something to somebody in person, then you probably should not be writing it here.

This should be obvious but, just in case: profanity, threats, slurs against any group (sexual, racial, gender, etc.) will not be tolerated.


Stay close to the original topic being discussed
  • If you are starting a new thread choose a reasonable sub-forum to start your thread. (If you choose incorrectly don't worry, we can fix that.)
  • If you are responding to a thread, stay on topic - the original poster was trying to achieve something. You can always start a new thread instead of potentially "hijacking" an existing thread.



Contribute something meaningful

To put things in engineering terms, we value a high signal to noise ratio. Coming here should not be a waste of time.
  • This is not a chat room. If you are taking less than 30 seconds to make a post then you are probably doing something wrong. A post should be on topic, clear, and contribute something meaningful to the discussion. If people read your posts and feel that their time as been wasted, they will stop reading your posts. Worse yet, they will stop visiting and we'll lose their experience and contributions.
  • Do not bump threads.
  • Do not "necro-post" unless you are following up to a specific person on a specific thread. And even then, that person may have moved on. Just start a new thread for your related topic.
  • Use the Private Message system for posts that are targeted at a specific person.


"PM Sent!" messages (or, how to use the Private Message system)

This forum has a private message feature that we want people to use for messages that are not of general interest to other members.

In short, if you are going to reply to a thread and that reply is targeted to a specific individual and not of interest to anybody else (either now or in the future) then send a private message instead.

Here are some obvious examples of when you should not reply to a thread and use the PM system instead:
  • "PM Sent!": Do not tell the rest of us that you sent a PM ... the forum software will tell the other person that they have a PM waiting.
  • "How much is shipping to ....": This is a very specific and directed question that is not of interest to anybody else.


Why do we have this policy? Sending a "PM Sent!" type message basically wastes everybody else's time by making them having to scroll past a post in a thread that looks to be updated, when the update is not meaningful. And the person you are sending the PM to will be notified by the forum software that they have a message waiting for them. Look up at the top near the right edge where it says 'Notifications' ... if you have a PM waiting, it will tell you there.

Copyright and other legal issues

We are here to discuss vintage computing, so discussing software, books, and other intellectual property that is on-topic is fine. We don't want people using these forums to discuss or enable copyright violations or other things that are against the law; whether you agree with the law or not is irrelevant. Do not use our resources for something that is legally or morally questionable.

Our discussions here generally fall under "fair use." Telling people how to pirate a software title is an example of something that is not allowable here.


Reporting problematic posts

If you see spam, a wildly off-topic post, or something abusive or illegal please report the thread by clicking on the "Report Post" icon. (It looks like an exclamation point in a triangle and it is available under every post.) This send a notification to all of the moderators, so somebody will see it and deal with it.

If you are unsure you may consider sending a private message to a moderator instead.


New user moderation

New users are directly moderated so that we can weed spammers out early. This means that for your first 10 posts you will have some delay before they are seen. We understand this can be disruptive to the flow of conversation and we try to keep up with our new user moderation duties to avoid undue inconvenience. Please do not make duplicate posts, extra posts to bump your post count, or ask the moderators to expedite this process; 10 moderated posts will go by quickly.

New users also have a smaller personal message inbox limit and are rate limited when sending PMs to other users.


Other suggestions
  • Use Google, books, or other definitive sources. There is a lot of information out there.
  • Don't make people guess at what you are trying to say; we are not mind readers. Be clear and concise.
  • Spelling and grammar are not rated, but they do make a post easier to read.
See more
See less

Recursing directories in plain old DOS (not NT)

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

    Recursing directories in plain old DOS (not NT)

    All --

    I'm working on a Windows 3.1-related project which has a folder with say 20 subdirectories, each with the code (and makefile) for a driver. The compiler package is in the path, so my idea was to use a "for" loop to traverse into each folder, run NMAKE, then go to the next folder.

    I've done some searching and it seems this is easily done...in Windows NT...not DOS. I also thought about creating a file containing the directory names (one name per line), but I can't figure out how to make that work, either.

    Batch file programming wasn't my strength back then, and apparently still isn't. Maybe there's a program out there that does this. If so, I'd appreciate knowing the name.

    Thanks!

    Rich

    Rich
    Web site: http://cini.classiccmp.org/
    Web site: http://altair32.classiccmp.org/

    #2
    Here is a tool I keep in my DOS tool box called RECURSE (13KB)

    www.kc8eyt.com/downloads/RECURSE.EXE

    It will run a DOS command in the current directory and all sub directories in the tree from that point

    Example:

    RECURSE DEL *.BAK

    The above command will delete all files with the extension BAK in the current directory and all sub directories.

    This little tool may help you achieve your goal.

    Comment


      #3
      Originally posted by kc8eyt View Post
      Here is a tool I keep in my DOS tool box called RECURSE (13KB)

      www.kc8eyt.com/downloads/RECURSE.EXE

      It will run a DOS command in the current directory and all sub directories in the tree from that point

      Example:

      RECURSE DEL *.BAK

      The above command will delete all files with the extension BAK in the current directory and all sub directories.

      This little tool may help you achieve your goal.
      Outstanding! Thanks.

      Next thing I'm looking for -- and maybe you have this too -- is a tool that will perform that recursion from a list. So, a file would contain a list of directories and it would only recurse into those directories. It would just be a way to avoid recursing into non-code folders, like "docs" and "include", for example.

      Thanks again!
      Rich
      Rich
      Web site: http://cini.classiccmp.org/
      Web site: http://altair32.classiccmp.org/

      Comment


        #4
        Originally posted by RichCini View Post

        Outstanding! Thanks.

        Next thing I'm looking for -- and maybe you have this too -- is a tool that will perform that recursion from a list. So, a file would contain a list of directories and it would only recurse into those directories. It would just be a way to avoid recursing into non-code folders, like "docs" and "include", for example.

        Thanks again!
        Rich
        You could write a simple QuickBasic 4.5 program to do that and then SHELL your desired command to each sub directory. Something like this:

        OPEN "LIST.TXT" FOR INPUT AS #1
        DO
        LINE INPUT Subdir$
        Subdir$ = "."+Subdir$+""
        SHELL Subdir$ + "<your command here>"
        LOOP UNTIL EOF(!)
        CLOSE #1
        Last edited by kc8eyt; June 8, 2021, 08:23 PM.

        Comment


          #5
          On line 4 there should be a backslash inside the quotes after the . and again a lone backslash inside the second set of quotes.

          They keep getting stripped when I save?

          Code:
          OPEN "LIST.TXT" FOR INPUT AS #1
          DO
              LINE INPUT #1, Subdir$
              Subdir$ = ".\" + Subdir$ + "\"
              SHELL Subdir$ + "<your command here>"
          LOOP UNTIL EOF(1)
          CLOSE #1
          Let's see if code tags help.
          Last edited by kc8eyt; June 8, 2021, 08:30 PM.

          Comment


            #6
            There's also a sort-of command-line C program in SIMTEL20 called CENVI or CENWIN. Very clever stuff.
            Somewhere in SIMTEL20 is my contribution called IRP.

            To delete every .BAK file in a tree, you'd do something like this:

            DIR /S /B *.BAK } IRP DEL @1

            Lots of ways to skin this cat.

            Comment


              #7
              If you know sed(1) from Unix, you can get a DOS version of SED and use it to transform a list of directories into a batch file (the one I have is 22K). Once upon a time I wrote a DOS software deployment tool that was basically batch files using sed to modify files. In NT you can just pipe the output from sed into cmd.exe, but in DOS you needed to put the output in a .bat file first, then "call" it. I know it works in DOS 5.x and 6.x but I don't recall if I've ever tested it in earlier versions.

              If you don't already know sed this may not be a convenient time to learn it.

              Comment


                #8
                This is good stuff. I have the SIMTEL20 CD here so I can look for CEN*. I like the idea of BASIC since that's part of DOS (I'm running 6.22 in the VM) and it gives me an excuse to try it. Will report back once I give it a try.

                I'm trying to replicate a build tool used in the NT DDK which, among other things, traverses a folder tree and runs the build on each folder. All you have to do is put a new source folder in the tree and add the name to the text file with the directories in it. I did try RECURSE, and a PC/Magazine analog called SWEEP and they work fine, but of course barf in folders that have no buildable targets. Feels like the BASIC program or maybe CENVI will do it.

                Rich
                Web site: http://cini.classiccmp.org/
                Web site: http://altair32.classiccmp.org/

                Comment


                  #9
                  It might be using the backslash as an escape character.

                  Let's see...

                  OPEN "LIST.TXT" FOR INPUT AS #1
                  DO
                  LINE INPUT Subdir$
                  Subdir$ = ".\"+Subdir$+"\"
                  SHELL Subdir$ + "<your command here>"
                  LOOP UNTIL EOF(!)
                  CLOSE #1

                  Yes, it is.

                  Comment


                    #10
                    Originally posted by Robbbert View Post
                    It might be using the backslash as an escape character.

                    Let's see...

                    OPEN "LIST.TXT" FOR INPUT AS #1
                    DO
                    LINE INPUT Subdir$
                    Subdir$ = "."+Subdir$+""
                    SHELL Subdir$ + "<your command here>"
                    LOOP UNTIL EOF(!)
                    CLOSE #1

                    Yes, it is.
                    Yeah, I was a dummy for not using CODE tags in the first place. The second listing in the code box is correct.

                    Comment


                      #11
                      Ok, I gave the corrected code a try and it doesn't work as-is, but I believe it's because of how NMAKER works and how the MAKEFILES are constructed. If you edit it as follows, it works just fine. I think the makefiles rely on the working directory changing. Thanks for the help with this!


                      Code:
                      OPEN "LIST.TXT" FOR INPUT AS #1 DO LINE INPUT #1, Subdir$
                      CHDIR Subdir$
                      SHELL "nmaker"
                      CHDIR ".."
                      LOOP UNTIL EOF(1)
                      CLOSE #1
                      Rich
                      Rich
                      Web site: http://cini.classiccmp.org/
                      Web site: http://altair32.classiccmp.org/

                      Comment


                        #12
                        Originally posted by RichCini View Post
                        Ok, I gave the corrected code a try and it doesn't work as-is, but I believe it's because of how NMAKER works and how the MAKEFILES are constructed. If you edit it as follows, it works just fine. I think the makefiles rely on the working directory changing. Thanks for the help with this!


                        Code:
                        OPEN "LIST.TXT" FOR INPUT AS #1 DO LINE INPUT #1, Subdir$
                        CHDIR Subdir$
                        SHELL "nmaker"
                        CHDIR ".."
                        LOOP UNTIL EOF(1)
                        CLOSE #1
                        Rich
                        Cool, glad you were able to make it work. The code I posted was pretty general, glad you were able to modify it to your needs.

                        Comment


                          #13
                          To top this off, I'll submit a gem I penned in 1985. Essentially takes a list of files from stdin, (even more than one file per line), parses them and executes a program on them.

                          Code:
                          ; Honors -
                          ; !@ - the whole line
                          ; !a - a parameter
                          ; !:a - the diskette drive name, with the :,
                          ;        null if none specified
                          ; !\a - the path name up to, but not including the file
                          ;         name, and excluding the drive name. Includes
                          ;         terminal '\'.
                          ; !*a - the file name, not including the extension
                          ; !.a - the extension, if any. Includes a leading "."
                          ;
                          ; Note also, if the command starts with "@", the command isn't echoed
                          ; to stdout before execution.
                          About 1K executable.

                          MODS: PLEASE fix inclusion of pasted source to not elide multiple spaces.

                          Attached Files

                          Comment

                          Working...
                          X