FindFirst fixes

This commit is contained in:
Rick Parrish 2013-02-07 14:30:29 -05:00
parent 60e58f0b7e
commit d6ff4957c2
3 changed files with 9 additions and 9 deletions

View File

@ -14,7 +14,6 @@ Ported to Win32 by Rick Parrish<br />
TODO list:<br /> TODO list:<br />
<ul> <ul>
<li>Implement any REETODOs that appear in compiled executables</li> <li>Implement any REETODOs that appear in compiled executables</li>
<li>Anything passing 0 for the Attr parameter to FindFirst should pass AnyFile instead (VP returns no files when 0 is passed for Attr)</li>
<li>Investigate FILEMODE usage to see if FILEMODEREADWRITE, TEXTMODEREAD or TEXTMODEREADWRITE should be used</li> <li>Investigate FILEMODE usage to see if FILEMODEREADWRITE, TEXTMODEREAD or TEXTMODEREADWRITE should be used</li>
<li>Find/correct any usage of FOR loop variables after the loop (since they are 1 greater in VP than in BP</li> <li>Find/correct any usage of FOR loop variables after the loop (since they are 1 greater in VP than in BP</li>
<li>Find/correct any file i/o on untyped files where Words or LongInts are being read</li> <li>Find/correct any file i/o on untyped files where Words or LongInts are being read</li>
@ -28,4 +27,5 @@ Completed list<br />
<li>TYPEs of OF INTEGER to OF SMALLINT (just in case they're used in a RECORD)</li> <li>TYPEs of OF INTEGER to OF SMALLINT (just in case they're used in a RECORD)</li>
<li>WORD in RECORD to SMALLWORD</li> <li>WORD in RECORD to SMALLWORD</li>
<li>INTEGER in RECORD to SMALLINT</li> <li>INTEGER in RECORD to SMALLINT</li>
<li>Anything passing 0 for the Attr parameter to FindFirst should pass AnyFile instead (VP returns no files when 0 is passed for Attr)</li>
</ul> </ul>

View File

@ -3857,7 +3857,7 @@ FUNCTION MaxChatRec: LongInt;
VAR VAR
DirInfo1: SearchRec; DirInfo1: SearchRec;
BEGIN BEGIN
FindFirst(General.TempPath+'MSG'+IntToStr(ThisNode)+'.TMP',0,DirInfo1); FindFirst(General.TempPath+'MSG'+IntToStr(ThisNode)+'.TMP',AnyFile,DirInfo1);
IF (DOSError = 0) THEN IF (DOSError = 0) THEN
MaxChatRec := DirInfo1.Size MaxChatRec := DirInfo1.Size
ELSE ELSE
@ -3868,7 +3868,7 @@ FUNCTION MaxNodes: Byte;
VAR VAR
DirInfo1: SearchRec; DirInfo1: SearchRec;
BEGIN BEGIN
FindFirst(General.DataPath+'MULTNODE.DAT',0,DirInfo1); FindFirst(General.DataPath+'MULTNODE.DAT',AnyFile,DirInfo1);
IF (DOSError = 0) THEN IF (DOSError = 0) THEN
MaxNodes := (DirInfo1.Size DIV SizeOf(NodeRecordType)) MaxNodes := (DirInfo1.Size DIV SizeOf(NodeRecordType))
ELSE ELSE
@ -3963,7 +3963,7 @@ FUNCTION MaxUsers: Integer;
VAR VAR
DirInfo1: SearchRec; DirInfo1: SearchRec;
BEGIN BEGIN
FindFirst(General.DataPath+'USERS.DAT',0,DirInfo1); FindFirst(General.DataPath+'USERS.DAT',AnyFile,DirInfo1);
IF (DOSError = 0) THEN IF (DOSError = 0) THEN
MaxUsers := (DirInfo1.Size DIV SizeOf(UserRecordType)) MaxUsers := (DirInfo1.Size DIV SizeOf(UserRecordType))
ELSE ELSE
@ -3974,7 +3974,7 @@ FUNCTION MaxIDXRec: Integer;
VAR VAR
DirInfo1: SearchRec; DirInfo1: SearchRec;
BEGIN BEGIN
FindFirst(General.DataPath+'USERS.IDX',0,DirInfo1); FindFirst(General.DataPath+'USERS.IDX',AnyFile,DirInfo1);
IF (DOSError = 0) THEN IF (DOSError = 0) THEN
MaxIDXRec := (DirInfo1.Size DIV SizeOf(UserIDXRec)) MaxIDXRec := (DirInfo1.Size DIV SizeOf(UserIDXRec))
ELSE ELSE
@ -3987,7 +3987,7 @@ FUNCTION HiMsg: Word;
VAR VAR
DirInfo1: SearchRec; DirInfo1: SearchRec;
BEGIN BEGIN
FindFirst(General.MsgPath+MemMsgArea.FileName+'.HDR',0,DirInfo1); FindFirst(General.MsgPath+MemMsgArea.FileName+'.HDR',AnyFile,DirInfo1);
IF (DOSError = 0) THEN IF (DOSError = 0) THEN
HiMsg := (DirInfo1.Size DIV SizeOf(MHeaderRec)) HiMsg := (DirInfo1.Size DIV SizeOf(MHeaderRec))
ELSE ELSE

View File

@ -762,7 +762,7 @@ BEGIN
LogError(MemMsgPath+'HI_WATER.MRK/Read Record 0 Error - '+IntToStr(LastError)+' (Proc: GetMsgList)'); LogError(MemMsgPath+'HI_WATER.MRK/Read Record 0 Error - '+IntToStr(LastError)+' (Proc: GetMsgList)');
Exit; Exit;
END; END;
FindFirst(MemMsgPath+IntToStr(HiWater)+'.MSG',0,DirInfo); FindFirst(MemMsgPath+IntToStr(HiWater)+'.MSG',AnyFile,DirInfo);
IF (DOSError <> 0) THEN IF (DOSError <> 0) THEN
HiWater := 1; HiWater := 1;
END; END;
@ -779,7 +779,7 @@ BEGIN
END; END;
HighMsg := 1; HighMsg := 1;
LowMsg := 65535; LowMsg := 65535;
FindFirst(MemMsgPath+'*.MSG',0,DirInfo); FindFirst(MemMsgPath+'*.MSG',AnyFile,DirInfo);
WHILE (DOSError = 0) DO WHILE (DOSError = 0) DO
BEGIN BEGIN
FidoMsgNum := StrToInt(DirInfo.Name); FidoMsgNum := StrToInt(DirInfo.Name);
@ -868,7 +868,7 @@ BEGIN
ELSE ELSE
BEGIN BEGIN
Purged := TRUE; Purged := TRUE;
FindFirst(MemMsgPath+'*.MSG',0,DirInfo); FindFirst(MemMsgPath+'*.MSG',AnyFile,DirInfo);
IF (DOSError <> 0) THEN IF (DOSError <> 0) THEN
Purged := FALSE Purged := FALSE
ELSE ELSE