Defining external file?

in blender 2.49, I want to retrieve a specific file “test.txt” in my external directory. For right now, the only way I know how to retrieve the file is by guessing the integer of the file in the directory list.

Example: Test = Directory[2]

However, my library is subject to change so I need a way to retrieve my file specifically by its name. Here is what ive tried so far:

File = Directory[“Test.txt”]

file = Directory.Test.txt

file = Directory(‘Test.txt’)

none of these methods seem to work

Does anyone know a way to do this?

for anyone else…

for obj in Directory:
if obj == ‘Your File’:
your File = obj;

Why not just use the Python open method?

file = open('Test.txt', 'r') # open 'Test.txt' in read mode

well. that works as well.