Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
List of file names
#1
I am working on a project where I need to list all file names in a directory with the same extension. The list can either be in an array or a text file to be used by the program.
Reply
#2
And you're telling us this because?

...
...
...

Oh, you need help Tongue
Reply
#3
Look up: Int 21h AH=4E and Int 21h AH=4F.

That's what you need if you wish to run without external files.

If you want external files, you could do something like:
Code:
OPEN "SHOW.BAT" FOR OUTPUT AS #1
   PRINT #1, "DIR *.EXE > MYFILE.DAT"
CLOSE #1

SHELL "SHOW.BAT" 'or SHELL "CMD SHOW.BAT"
Then you only need to read the MYFILE.DAT Wink
Reply
#4
Neo,
Why do I need to do the DIR via a batchfile?
Why can't I just do:

SHELL "DIR *.EXE/B > MYFILEE.DAT"

Depending on the operating system you might have to:

SHELL "CMD DIR *.EXE/B > MYFILEE.DAT"

The /B is for bare output --- filename only. I'm sure you don't need all the other information.

PS: Watch out: since you're probably running a Windows machine, there is a remote posibility that you might have some Windows filenames in the subject directory. Example: If you have a file called CHACHACHA.EXEL in the directory, all the above DIRs will find and use it because it has .EXE in it.
*****
Reply
#5
Quote:And you're telling us this because?

...
...
...

Oh, you need help Tongue

That post was about as pointless as this one pointing out that fact.
ovaProgramming.

One night I had a dream where I was breaking balls. The next morning, BALLSBREAKER was born.

Quote: Excellent. Now you can have things without paying for them.

BALLSBREAKER 2
~-_-Status Report-_-~
Engine: 94%
Graphics: 95%
Sound: 100%
A Severe Error has crippled BB2 for the time being... I have to figure it out, but until then you won't see much of it Sad.
-----------------------------
Reply
#6
Then why did you post?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)