Re: Finding particular files in the given directory path !
- From: Biswapesh Chattopadhyay <biswapesh_chatterjee tcscal co in>
- To: GTK App Devel <gtk-app-devel-list gnome org>
- Cc: Anita Dixit <anitad mahindrabt com>
- Subject: Re: Finding particular files in the given directory path !
- Date: 03 Jul 2002 09:42:40 +0530
On Tue, 2002-07-02 at 22:19, gtk-app-devel-list-admin gnome org wrote:
/* I'm sure you can come up with something better than "strstr()"
(I guess theres some "glib" way but this will work ;P )
*/
DIR *dir;
struct dirent *entry;
if ((dir = opendir(const char *path) != NULL) {
while ((entry = readdir(dir)) {
if (strstr(entry->d_name, ".pdf")) {
use fnmatch() instead - it is more flexible - and no, it is not glib
specific.
/* add to a list or something ;) */
}
}
Need to do a closedir() here.
}
Hope this helps,
Biswa.
Cheers
-Tristan
--------------------
Anita Dixit wrote:
Hi ,
I am using Gtk+ 1.2.9
If I have a certain directory path and have to find some files say I
have to search all the .pdf files available in that directory .
How to go about it ?
Thanks and Regards,
-Anita
*********************************************************
Disclaimer
This message (including any attachments) contains
confidential information intended for a specific
individual and purpose, and is protected by law.
If you are not the intended recipient, you should
delete this message and are hereby notified that
any disclosure, copying, or distribution of this
message, or the taking of any action based on it,
is strictly prohibited.
*********************************************************
Visit us at http://www.mahindrabt.com
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
_______________________________________________
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]