Originally posted by Scott Turchin
View Post

#COMPILE EXE #DIM ALL FUNCTION PBMAIN() AS LONG LOCAL wsFile AS WSTRING LOCAL strCOntent AS STRING LOCAL x,ff AS LONG 'Build some test files strCOntent = "Something in the file" FOR x = 1 TO 10 ff = FREEFILE OPEN "Test" & FORMAT$(x,"00") & ".dmo" FOR OUTPUT AS #ff PRINT #ff, strContent CLOSE #ff NEXT ? "check the contents of the folder, there should be 10 matching files there" ' iterate through the file wsFile = DIR$(EXE.PATH$ & "\Test*.dmo") WHILE wsFile > "" KILL wsFile 'delete from the folder while the DIR$() file handle is open wsFile = DIR$() WEND DIR$ CLOSE ? "check the contents of the folder!!! - Deleting the files worked while the DIR$() file handle was open END FUNCTION '
wstrFIlename = DIR$("*.bas") WHILE wstrFileName > "" IF NOT FileExists(wstrBackupLocation" & wstrFilename THEN FILECOPY strFilename, wstrBackupLocation" & wstrFilename END IF wstrFilename = DIR$(NEXT) WEND DIR$ CLOSE
FUNCTION exist(fname$) as DWORD FUNCTION = Len( Dir$(fname$, 17) ) > 0 END FUNCTION
FUNCTION Exist(FileSpec AS STRING) EXPORT AS INTEGER LOCAL fd AS WIN32_FIND_DATA LOCAL hFind AS DWORD IF LEN(FileSpec) THEN hFind = FindFirstFile(BYCOPY FileSpec, fd) IF hFind <> %INVALID_HANDLE_VALUE THEN FindClose hFind FUNCTION = %TRUE END IF END IF END FUNCTION
FUNCTION exist(fname$) as DWORD FUNCTION = Len( Dir$(fname$, 17) ) > 0 END FUNCTION
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: