473,405 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

C programming question Word Count for all files in a directory

Hello. I am new to C programming. I needed help with a C program that is fairly simple but I am stuck since I am new to C programming.

It involves using fopen() to iterate through all files in that directory, and get the word count. It also involves multithreaded programming.

I have to process an x number of files for the word count in threads. For example, I have to use 5 threads to process 100 files. Meaning 20 files per thread, to get their word counts.

I have a file that lists all the file names in the directory. Now, how would I store line by line the file names with fopen() and at the same time, open the file for word counting using multiple threads?

If you'd like to specifically see the code that I have for this so far, let me know. Thank you.
Apr 7 '11 #1
1 2972
donbock
2,426 Expert 2GB
Support for multithreading is outside the scope of the C Standard. You will have to rely on the operating system. How you do this depends on what operating system you're using.
Apr 7 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: rbt | last post by:
I assume that there's a better way than this to count the files in a directory recursively. Is there??? def count_em(valid_path): x = 0 for root, dirs, files in os.walk(valid_path): for f in...
3
by: agent mike | last post by:
I am trying to count words in a text file. I am using the following code: in_stream.get(c); if(c == ' ' || c == '.' || c == ',') word_count++; and the word count is too low. If I include "...
3
by: kaplooeymom | last post by:
I'm using Lebans RTF control in Access 2003. I'm looking for a way to get accurate word counts for a field - not including the rich text markup. I'm trying to avoid pasting the field into word,...
3
by: Oliver Saunders | last post by:
I was really shocked not to find this already submitted by someone in the PHP manual notes. <? function jnWordCount($text) { $results = array(); $pattern = '/+\S+/'; // matches wordy...
1
by: trihanhcie | last post by:
Hi I have several textarea in the same page. I would like to count the words in each textarea without any interaction with each other. Here's the code I used for the count : <script...
6
by: Jonesgj | last post by:
Hi, Whats the best way to do a word count of the content of a rich text box? Thanks in advance Jones GJ
1
by: deejayquai | last post by:
Hi Does anyone know if it is possible to display a word count as and when a user is inputting text into a memo field on a form. The code I'm using below is fine when applied to the 'On Exit'...
0
by: Shat T. Cat | last post by:
Hello, I have a program that I originally wrote in VB6 that breaks down plain-text Profit & Loss reports from my organization's Accounting system into separate files for each Cost Center (office...
4
by: FunkHouse9 | last post by:
I built a form that is depentent on a word count a word count. What I have works just fine in IE but doesn't work in Firefox. It changes the count from 0 to 1 and that's as far as it goes. Here's...
2
by: beanie | last post by:
i am a beginer in c programming and i am trying to Create a Concordance of Word Count for a Text File but my code is not working.pls can anyone helpme out.here is my code: #include <stdio.h>...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.