[syslinux] [PATCH] cat.c32: check if filename exists

Michael D. Setzer II mikes at kuentos.guam.net
Tue May 4 07:49:27 PDT 2010


On 4 May 2010 at 13:33, Liu Aleaxander wrote:

Date sent:      	Tue, 4 May 2010 13:33:21 +0800
From:           	Liu Aleaxander <aleaxander at gmail.com>
To:             	For discussion of Syslinux and tftp-hpa 
<syslinux at zytor.com>
Subject:        	Re: [syslinux] [PATCH] cat.c32: check if filename exists
Send reply to:  	For discussion of Syslinux and tftp-hpa 
<syslinux at zytor.com>
	<mailto:syslinux-
request at zytor.com?subject=unsubscribe>
	<mailto:syslinux-request at zytor.com?subject=subscribe>

> On Tue, May 4, 2010 at 12:27 PM, Michael D. Setzer II
> <mikes at kuentos.guam.net> wrote:
> > On 3 May 2010 at 17:07, Gert Hulselmans wrote:
> >>> cat.c32: check if filename exists.
> >>
> >
> Hello Michael,
> 
> > Related to this. I have used a modified version of cat.c32 to display some
> > text files from the isolinux menu. Just built a new image using the pre-40,
> > and it locks when trying to display the file.
> It would be better if you put the code of your modified version of
> cat.c32 here:)

Modified code 

#include <stdio.h>
#include <stdlib.h>
#include <console.h>

int main(int argc, char *argv[])
{
  FILE *f;
  int ch;
//  int i;

  openconsole(&dev_stdcon_r, &dev_stdcon_w);

  if ( argc < 2 ) {
    fprintf(stderr, "Missing file name!\n");
    exit(1);
  }

  f = fopen(argv[1], "r");
  while ( (ch = getc(f)) != EOF )
    putchar(ch);
  printf("\nPress Enter to Return to Menu\n");
  fclose(f);

  return 0;
}


> 
> > I also have the original
> > display.c32 and tried it from the command prompt, and it freezes as well.
> Are you using the right c32 file matching syslinux-4.00?
> 
> 
The display.c32 is the one from the pre40, and it locks up just like the 
modified cat.c32.

When back to the previous version of the build that uses the released version 
of syslinux. In this case the cat.c32 works fine to display the files.

Only a power down will restart system.




> 
> > At the very beginning, it flashes a Hello, World from (hello.c) message?
> 
> It's just a debug feature.
> hpa, is this the time to get rid of it?


> 
> 
> Thanks!
> 
> -- 
> regards
> Liu Aleaxander
> 
> _______________________________________________
> Syslinux mailing list
> Submissions to Syslinux at zytor.com
> Unsubscribe or set options at:
> http://www.zytor.com/mailman/listinfo/syslinux
> Please do not send private replies to mailing list traffic.
> 


+----------------------------------------------------------+
  Michael D. Setzer II -  Computer Science Instructor      
  Guam Community College  Computer Center                  
  mailto:mikes at kuentos.guam.net                            
  mailto:msetzerii at gmail.com
  http://www.guam.net/home/mikes
  Guam - Where America's Day Begins                        
+----------------------------------------------------------+

http://setiathome.berkeley.edu (Original)
Number of Seti Units Returned:  19,471
Processing time:  32 years, 290 days, 12 hours, 58 minutes
(Total Hours: 287,489)

BOINC at HOME CREDITS
SETI         9628412.959704   |   EINSTEIN     3959636.800851
ROSETTA      1894882.412180   |   ABC           790361.739164




More information about the Syslinux mailing list