popen « fgets « C File Q&A

Home
C File Q&A
1.array
2.binary
3.delete
4.Development
5.directory
6.fgets
7.fopen
8.fprintf
9.fscanf
10.fwrite
11.header
12.include
13.input
14.LINE
15.linux
16.open
17.output
18.pointer
19.read
20.size
21.string
22.struct
23.Text
24.windows
25.write
C File Q&A » fgets » popen 

1. popen and fgets    cboard.cprogramming.com

Hello, I need to make a program to read a text file and set it to a label... I thought I could use fgets and popen to do it but I'm lost on programming it!! Check out the code: FILE *page= (FILE *)popen("cat rox.txt","r"); GtkWidget * label = lookup_widget(GTK_WIDGET(button), "label1"); gtk_label_set_text(GTK_LABEL(label),page); I know that gtk_label_set_text is waiting a gchar, and I'm ...

2. popen and fgets problem    cboard.cprogramming.com

3. What's wrong with my func - popen fgets...    forums.devshed.com

Using Linux/C - can't get the following to work...beginner please help void Func_Get_Image() { int Current_Image_Num = 1; char Var_Get_Image[MAX_DIR_LENGTH] = { 0x0 }; sprintf( Var_Get_Image, "find $HOME/Pictures -iregex '.*\.\(gif\|jpg\|jpeg\|bmp\|png\||tif\||tiff\||svg\)' | sed %d'q;d'", Current_Image_Num); FILE *in=popen("Var_Get_Image","r"); char tmp[MAX_DIR_LENGTH]={0x0}; while(fgets(tmp,sizeof(tmp),in)) printf("%s",tmp); pclose(in); } This compiles...but Var_Get_Image is being sent as the command rather than the contents of Var_Get_Image (find $HOME/Pictures -iregex '.*\.\(gif\|jpg\|jpeg\|bmp\|png\||tif\||tiff\||svg\)' ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.