Question: I use [this implementation of SortedCollection](http://code.activestate.com/recipes/577197-sortedcollection/).

```
>>> a = SortedCollection(key=itemgetter(1))
>>> a.insert_right(('A',5))
>>> a.insert_right(('B',3))
>>> a.insert_right(('C',7))
>>> a
SortedCollection([('B', 3), ('A', 5), ('C', 7)], key=<operator.itemgetter object at 0x028C99B0>)

```

What would be the syntax of finding the index of the item with `'A'`?  

Notice that `'A'` is not the sorting key I chose.

Here's a failed way to do it:

```
>>> a.find(lambda item: item[0]=='a')

Traceback (most recent call last):
  File "<pyshell#32>", line 1, in <module>
    a.find(k=lambda item: item[0]=='a')
  File "C:/dev/sorted_collection.py", line 167, in find
    raise ValueError('No item found with key equal to: %r' % (k,))
ValueError: No item found with key equal to: <function <lambda> at 0x028DB270>

```

Answer: 
Come on, try it your self:

**Step1:** Read all the file Names from a directory.

**Step2:** Store the list of Files to a List.

**Step3:** Iterate the list, Write a conditions with a use the File.getName() method to compare and the name and your input.

```
if(file.getName().equals(inputFileName)){
   return "boooo! I have found You!"  
}

```
this should be of help: [File search](http://download.oracle.com/javase/tutorial/essential/io/find.html)

A definitive source for information.

EDIT: thought of something really simple:

```
String[] drives = new String[]{"C:\\", "D:\\"};
File file;

for(String drive : drives)
{
    file = new File(drive + "abc.txt");
    JOptionPane.showMessageDialog(null, file.exists());
}

```

you can replace the showMessageDialogBox with whatever you want to do if the file exists.