Date: Mon, 2 Dec 1996 16:57:36 +0200 (IST) From: Eli Zaretskii To: "Rodger D. Ballard Jr." cc: djgpp AT delorie DOT com Subject: Re: DJGPP w/long file name support In-Reply-To: <199612020659.WAA11416@ridge.spiritone.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Sun, 1 Dec 1996, Rodger D. Ballard Jr. wrote: > I am sorry for not being too clear on that one. This question pertains more > towards C and for instance if I wanted to make a program that supports long > file name support under a Win95 dos box. I was curious if anyone knew how > to implement this in a seperate program via DJGPP C code (I have a feeling > it would involve inline assembler, something I have never touched under > DJ.) Unless I misunderstand you completely, I already answered this: *every* program compiled with DJGPP supports long filenames when you run it from Windows 95 DOS box. This includes programs compiled by you, not only those that come pre-built with the DJGPP distribution. You don't have to do anything special to get this support: it's built into the DJGPP runtime library functions which your program calls. For instance, you can say this in your program: FILE *fp = fopen ("this_is_the_file_name.txt", "r"); When this is run on Windows 95, the function `fopen' will see that long filenames are supported on this platform and will then use the long filename version of DOS OpenFile function. This is all entirely automatic. > A perfect example is this: > > Construct a program that will add line numbers and colons in front of every > line in a specified file that supports long file names: > > A sample run might be: > > disptext this_is_the_file_name.txt Write your `disptext' in C, compile it with DJGPP, and you will get a program that can be run like that.