Well I got it to work.. in an odd way.
I had to specify the file extension too.. ".txt"
However I do not want to do this, is there a way around this?
Well I got it to work.. in an odd way.
I had to specify the file extension too.. ".txt"
However I do not want to do this, is there a way around this?
Yes, I apologize. All the other codes I've tried worked fine without the extension.
But Thank you for all the help I REALLY appreciate it
Except that Windows (newer versions, anyway) seems to default to kindly removing the extension from the Explorer window, which leads to n00bs in positions like this.
Hense the settings change I told him to make in the first part of the thread...
Control Panel -> Folder Options -> View tab -> uncheck "Hide extensions of known file types" ...
The stupid thing defaults to on, which is probably half the problem. People get used to not seeing extensions and soon enough they start creating files without them, even being bothered by seeing them. Then the entire File Associations mechanism, which is why why files have extensions in the first place, starts breaking down and next thing you know it's "Format C:\" time, yet again.
Afterthought: How the heck do you expect to write programs for an OS you don't even know how to use?
Last edited by CommonTater; 05-23-2011 at 04:28 PM.
You were given good advice in several ways by CommonTater.
If using a C99 compatible compiler, consider using: char fname[FILENAME_MAX];
FILENAME_MAX is defined in the <stdio.h> and is defined for the longest filename that an implentation will open.
I do not have a copy of the C90 standard to determine if this macro was defined in <stdio.h> in that version of the language standard also.