RE: Use of fgets, puts, rewind in Gtk+
- From: Madhusudan E <madhusudan huawei com>
- To: 'Sucheta Ghosh' <sucheta_t isical ac in>, gtk-app-devel-list gnome org
- Subject: RE: Use of fgets, puts, rewind in Gtk+
- Date: Fri, 13 Oct 2006 10:17:47 +0530
Hi,
There is absolutely no problem in doing file operations in
GTK based applications.
Just check the validity of your operations.
Check the validity of your file name , path, Security options ( Read only
etc).
Always remember to close the file.
Nothing to worry much, some silly thing has gone wrong.
Rgds,
Madhusudan E
Hello,
I wished to read a file and get some lines from there like this:
-----
fp=fopen("filename", "r");
for(k=0; k<8; k++){
n=a[k];
for (i=1; i<=n; i++) //Here 'n' is the line number
fgets(s, 100, fp);
puts(s);
rewind(fp);
}
-----
-----
This is the code snippet, which is working so well after compiling with
'gcc' compiler, but when I added this code inside Gtk+ callback.c, a
runtime error is occuring before execution of 'fgets'. I have already
included 'stdio.h', but even then it is not executing.
Do you have any idea that how to overcome this problem?
Thanks & regards,
Sucheta Ghosh
Indian Statistical Institute, Kolkata
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]