Are you in windows? Can you find the file in Windows Explorer? Is so, try to open it with a text editor, like note pad. If the file is there and correct, then you've saved it properly.
the problem is im using a program named putty, which saves the file to my school computers.
so i cannot open the file for normal viewing. but the files are accessible for use with putty.
other .txt files are stored there and my coding can open it.........just not the ones i created with my program
ive just tested it without using a variable to store the name and it work perfectly.........so everythings fine except using the variable as the file name
That's not a problem. Do a "dir" of your working directory and see of your file shows up. If it does, type "more <filename>" to view the file contents.
That way if you have any errors in your filename or if there is any problem in the filesystem, you'll know it right away and won't have to wonder "what the hell happened!"