|
-
Jun 30th, 2000, 11:39 AM
#1
Thread Starter
New Member
Hi!
A textfile is created with a batchfile.
I have to analyze this textfile, when it's there.
Now how can I check if the textfile is already there?
How can i delete it fast after checking?
And biggest question: How can I tell the programm to WAIT until there is a file to check?
I thank you very much for your time and help
Daemon72
PS: Is there any module out there, which can do all important file operations like deleting, moving, renaming, lookin if exist...?
-
Jun 30th, 2000, 11:59 AM
#2
Hyperactive Member
I use a function like this:
Code:
Public Function Exists(ByVal fn As String) As Boolean
On Error GoTo NO_FILE
Exists = (FileLen(fn) > 0)
Exit Function
NO_FILE:
Exists = False
End Function
-
Jun 30th, 2000, 12:29 PM
#3
Code:
if Dir(path) <> "" then msgbox "File does exist"
-
Jun 30th, 2000, 12:46 PM
#4
_______
..File system object has many features
'does file exist using fso
Dim sFile$
sFile = "Name And Path Of Your File"
Dim fs As Object
Set fs = CreateObject("Scripting.FileSystemObject")
StartOver:
If fs.fileexists(sFile$) = True Then
MsgBox "File Exists...Your code here!"
Else
MsgBox "Does Not Exist...Your code here!"
'perhaps you could loop it here till the file
does exist ie..goto StartOver:
End If
Set fs = Nothing
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|