ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old January 2nd, 2003, 04:37 PM
Heinz Heinz is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: Langley, BC Canada
Posts: 35 Heinz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 29 sec
Reputation Power: 7
I need to find a file but only have partial name

I'm looking for images in my asp page.

I know the path and first and last part of the filename.

Example filename: A01-30420.jpg

I have the A01- and the .jpeg. The ##### portion could be anything, but always numeric (sofar).

The A01 is unique, i.e. there will only be one file of A01-#####.jpg

I'm using fileExists object to confirm a file exists when I have the full filename but havn't been able to figure out how to get the full filename when I only have a partial.

I could rename the files, i.e. drop the -##### but I'd have to do that everytime I get new ones so I'd like to work with the original filename if at all possible.

Thanks in advance

Heinz
Comments on this post
Gran Roguismo agrees!

Reply With Quote
  #2  
Old January 7th, 2003, 04:57 PM
tron's Avatar
tron tron is offline
SwollenMember
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Location: the master control
Posts: 234 tron User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 44 m 46 sec
Reputation Power: 9
Think you could just get all of the files:

dir=server.MapPath(somedir)
Set fso = CreateObject("Scripting.FileSystemObject")
Set files = fso.GetFolder(dir)

then just use a loop to look for it...

i think you could even have somedir be C:\foo.* but i am not 100% sure on that

Reply With Quote
  #3  
Old January 7th, 2003, 05:54 PM
Heinz Heinz is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: Langley, BC Canada
Posts: 35 Heinz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 29 sec
Reputation Power: 7
Thanks Tron.

I did sort of a stopgap using basically what you described in an asp page to permanently rename and then I can look for the name directly.

Maybe next time I get a bunch I'll rethink/redo :-))

Heinz
Comments on this post
Gran Roguismo agrees!

Reply With Quote
  #4  
Old January 8th, 2003, 10:03 AM
tron's Avatar
tron tron is offline
SwollenMember
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Location: the master control
Posts: 234 tron User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 44 m 46 sec
Reputation Power: 9
so i guess you figured it out??

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > I need to find a file but only have partial name


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway