# FileSet Pattern Problem

**URL:** https://www.finalbuilder.com/forums/t/fileset-pattern-problem/119
**Category:** Discussion
**Created:** [June 28, 2006, 6:11am UTC](https://www.finalbuilder.com/forums/t/fileset-pattern-problem/119 "2006-06-28T06:11:25Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [June 28, 2006, 6:11am UTC](https://www.finalbuilder.com/forums/t/fileset-pattern-problem/119/1 "2006-06-28T06:11:25Z")

</div>

I’m trying to analyze a log file from a FB script. I need to get the most recent file in a directory. What I do is log the date and time into a variable and then set the FileSet pattern to look for a file after this date and time. This seems to work if I just run a portion of my script but fails each time I run the whole 3 hour script. When I look in the log at the date/time I have set into the variable and the date/time the file was created everything appears to be OK, yet, I get 0 files returned.   
  
1. Is there an easier way to accomplish this?  
  
2. In what format do I need to store the date and time so that it is usable by the FileSet pattern definition?   
  
3. The FileSet patterns only allows \* wildcards not ?, is this correct?

---

<div class="post-metadata">

### Author: ![angus](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/b3f665/32.png) [@angus](https://www.finalbuilder.com/forums/u/angus)
#### Post date: [June 29, 2006, 1:59am UTC](https://www.finalbuilder.com/forums/t/fileset-pattern-problem/119/2 "2006-06-29T01:59:46Z")

</div>

Hi Larry,  
  
1) There are other ways to do this, I don’t know if they are easier, though, and you should be able to do it with a FileSet. We’ll look into a “Sort FileSet” action for a future version of FB.  
  
Otherwise, there are a couple of VBScript functions on this thread which use the FileSystemObject to find the newest file in a directory:  
[http://www.codecomments.com/archive300-2006-2-551110.html](http://www.codecomments.com/archive300-2006-2-551110.html)  
  
2) The date/time will need to be stored in the current locale’s date/time format. "In the US, this is commonly MM/DD/YY HH:MM:SS format."  
  
3) No, the patterns should support ? as well as \*.  
  
How does the date/time you are getting from the Get Date/Time action compare to the modification date of the file you wish to match? Are you sure the file has been created/modified after the “now” date/time that you are receiving using the action?  
  
- Angus

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [June 29, 2006, 9:50am UTC](https://www.finalbuilder.com/forums/t/fileset-pattern-problem/119/3 "2006-06-29T09:50:49Z")

</div>

Thanks Angus this works great in the Run Script action. I thought I would take it one step further and attempt to make a Custom Action with Action Studio. I have posted question in the Action Studio forum directly related to this question. Can you please look for " Help With Script Error" there?
