Mar 21, 2002 #1 Guest_imported New member Joined Jan 1, 1970 Messages 0 Hi! I want to count and get the names of files in a dir I specify? how can I do this? Suffix
Mar 21, 2002 #2 Crox Programmer Joined Apr 3, 2000 Messages 895 Location NL Hi, a general method is starting with a command like: DIR *.* > DIR.OUT After that you read the file "DIR.OUT" as a text file. It depends on what environment you are running what you get. For example with Windows NT you can do: DIR *.* /X > DIR.OUT and you get the long names and the short names. To find out what your operating system can do, you can give the command DIR /? Some compilers have special routines for you to get the filenames in a general way. For example CA-REALIA has a DOS level interface. I hope this helps you. Regards, Crox Upvote 0 Downvote
Hi, a general method is starting with a command like: DIR *.* > DIR.OUT After that you read the file "DIR.OUT" as a text file. It depends on what environment you are running what you get. For example with Windows NT you can do: DIR *.* /X > DIR.OUT and you get the long names and the short names. To find out what your operating system can do, you can give the command DIR /? Some compilers have special routines for you to get the filenames in a general way. For example CA-REALIA has a DOS level interface. I hope this helps you. Regards, Crox