473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

File.Exists alternative?

Is there an alternate way to determine the existence of files other than
the File.Exists method. I have this code...

If File.Exists("tblm*.*") then
Kill("tblm*.*")
End If

The Kill method works fine with the asterisk as a placeholder but the
File.Exists method does not. I need some way to detect the presence of files
that all begin with tblm and then if there, delete them.
Any ideas? Thanks in advance!!

Dave
Nov 20 '05 #1
2 1819
On Wed, 07 Jan 2004 22:30:21 GMT, "Dave Harris" <dh******@woh.rr.com>
wrote:
Is there an alternate way to determine the existence of files other than
the File.Exists method. I have this code...

If File.Exists("tblm*.*") then
Kill("tblm*.*")
End If

The Kill method works fine with the asterisk as a placeholder but the
File.Exists method does not. I need some way to detect the presence of files
that all begin with tblm and then if there, delete them.
Any ideas? Thanks in advance!!

Dave


Try using something like this:

Imports System.IO

Dim szPath as String = Directory.GetCurrentDirectory()
If Directory.GetFiles("C:\TEMP", "tblm*.*").Length() > 0 Then
Kill("tblm*.*")
End If
// CHRIS

Nov 20 '05 #2
I believe that the Dir() function can take wildcards

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

48
by: Joseph | last post by:
Hi I'm writing a commercial program which must be reliable. It has to do some basic reading and writing to and from files on the hard disk, and also to a floppy. I have foreseen a potential...
17
by: Sean Ross | last post by:
Hi. Recently I made a small script to do some file transferring (among other things). I wanted to monitor the progress of the file transfer, so I needed to know the size of the files I was...
0
by: Nobody | last post by:
Hi All, In my application I have the following implementation for ClassA and ClassC invoking a call on ClassB. void ClassA::DoSomething() { int value = m_pClassB->Read(enum1); }
2
by: David Fickbohm | last post by:
People, I am trying to determine the creation date of files in a folder. I am using the following code to find the folder and confirm that files exist in the folder. If someone could give me an...
5
by: Rosa | last post by:
Hi, I'm experiencing a bit of a problem with security and file access from within a ASP.Net application... Locally (from an XP client) I manage to get any file or folder on my machine with...
1
by: Gustaf Liljegren | last post by:
I have a document with links written in the URI syntax, like this: file:///c:/folder/example1.xml file:///c:/folder/example2.xml I want to check if these file exists before I read them, but...
4
by: tfs | last post by:
Is there a way in asp.net to get the file properties such as: author, subject,title and category. Apparently, fileinfo doesn't have that. I need to get the these as we are going to use them for...
5
by: =?Utf-8?B?QWRyaWFuTW9ycmlz?= | last post by:
Hello! I'm trying to copy a file from another computer on the network that I do not have permission with my current logon details to access. If I open the folder using the Windows file manager...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.