Solved

how to open every file with the name 'README'

Posted on 2004-04-01
2
192 Views
Last Modified: 2010-04-16
Hi everybody, i  would like to write a program which allows to open every file with the 'Readme' name, don't matter which extension, in VB it would be something like

README.*

but in pascal, assuming i have a text file with the full name of 'README.TXT' and if i want to open it I can NOT do like this
assign(F, 'README')
pascal spits an error 'file not found'

can someone help me out of this ???

thanks to everyone in advance
Elvis
0
Comment
Question by:Elvis1
  • 2
2 Comments
 
LVL 2

Expert Comment

by:MrT-RSI
ID: 10733403
FindFirst(readme.*,AnyFile,sr);        //find all files matching readme.*; var sr : SearchRec
while DosError = 0 do begin
  Assign(F,sr.Name);                      //open file found in searchrec
  //do something with file
  Close(F);
  FindNext(sr);
end;
0
 
LVL 2

Accepted Solution

by:
MrT-RSI earned 50 total points
ID: 10733420
... ofcourse there should be quotes around 'readme.*':

FindFirst('readme.*',AnyFile,sr);        //find all files matching readme.*; var sr : SearchRec
while DosError = 0 do begin
  Assign(F,sr.Name);                      //open file found in searchrec
  //do something with file
  Close(F);
  FindNext(sr);
end;

... also: requires DOS unit
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Is your company's data protection keeping pace with virtualization? Here are 7 dynamic ways to adapt to rapid breakthroughs in technology.
Find out what the Office 365 disclaimer function is, why you would use it and its limited ability to create Office 365 signatures.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video discusses moving either the default database or any database to a new volume.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now