Solved

how to open every file with the name 'README'

Posted on 2004-04-01
2
197 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ROUND() from fbudf.dll only gives integers 2 1,063
Disable ctrl+alt+del 7 696
ADO Memory leak with DELPHI 2007 37 225
problem when i try to pack my dll file with upx 9 83
Deploying our service is a grudge match between customer benefits and customer pain. In one corner, rolling out fixes (yay!) and delivering new features (double yay!). In the other corner, training on new features (boo – sounds like work), and chan…
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

751 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