On Wed, Aug 26, 2009 at 10:03:40AM -0700, Dos-Man 64 wrote: > > > > On Aug 25, 9:46 pm, Robert Citek <[email protected]> wrote: > > On Tue, Aug 25, 2009 at 5:47 PM, Dos-Man 64<[email protected]> wrote: > > > I'll see if I can get the other one downloaded, but that's been really > > > the main problem I'm having so far since switching over is with trying > > > to download apps and then get them installed and running. I think I'm > > > batting .000 actually. Well, you have to hit the ball sooner or later > > > so I will keep trying :) > > > > What distro are you using? And on what hardware? > > > > Regards, > > - Robert > > > I'm at a half way point... I still have 98 installed on my hard > drives, so I'm running knoppix from the DVD. It's good enough right > now for me to learn (and not have to worry about breaking anything.) > The only problem is I don't have internet on my linux machine which > makes downloading anything apparently impossible. I'm making good > progress though. I learned a lot in the past week so far. > > This is what I have so far. It's working good. It runs dialog and > passes to it the list of all folders in the current folder. I just > need a function to convert an integer to a string... > > > #include <unistd.h> > #include <stdio.h> > #include <dirent.h> > #include <string.h> > #include <sys/stat.h> > #include <stdlib.h> > > void printdir(char * dir); > void inttostr(char * x); > > char curdir[266] = ""; > char cmdline[10001] = "dialog --menu \"$F_NAME,Choose folder\" 15 30 > 4"; > char temp = 0; > > int main() > { > getcwd(curdir, 265); > printdir(curdir); > //strcat(cmdline, " > dir185.tmp"); > system(cmdline); > } > > void printdir(char * dir) > { > DIR * dp; > char twobytes[2]=""; > > struct dirent * entry; > struct stat statbuf; > > if((dp=opendir(dir)) == NULL) > { > fprintf(stderr, "Failed.\n"); > return; > } > > while((entry=readdir(dp))!= NULL) > { > lstat(entry->d_name, &statbuf); > if(S_ISDIR(statbuf.st_mode)) > { > temp++; > strcat(cmdline," "); > twobytes[0] = temp; > strcat(cmdline,twobytes); > strcat(cmdline," "); > strcat(cmdline, entry->d_name); > } > } > closedir(dp); > } // end of printdir() > >
sprintf will convert an integer to a string. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Linux Users Group. To post a message, send email to [email protected] To unsubscribe, send email to [email protected] For more options, visit our group at http://groups.google.com/group/linuxusersgroup -~----------~----~----~----~------~----~------~--~---
