Thanks a lot. I have fixed some issues. But still I have vital issue that when I want to send file with choice 3 then write file name, the connection is gone.I mean also I can't send more files .The...
Type: Posts; User: Ph0x
Thanks a lot. I have fixed some issues. But still I have vital issue that when I want to send file with choice 3 then write file name, the connection is gone.I mean also I can't send more files .The...
I try to make multi-threaded server-client file transfer system in C. There are clients which will send or list or do other choice(in switch case you can see) and a server storing the files and serve...
#define _POSIX_C_SOURCE 200809L
#define _XOPEN_SOURCE 700
#include <unistd.h>
#include <dirent.h>
#include <stdlib.h>
#include <locale.h>
#include <string.h>
#include <ftw.h>
#include...
I try to go in folders and read files using fork(). I use file tree walk function to go in the folders recursively. The basic idea is that there will be children number of files and directory in a...
I'm unable to understand whether there is a guarantee about arising after fork(). While studying on chain process and fan process, I'm stuck. If I fork two times, the hierarchy is roughly
14687...
I try to print the grid with spaces regard to digits(units digit, tens digit,hundreds digit etc. ). It prints as expected when entered just one decimal numbers.(one digit numbers) If it is thought...
I try to put 4 symbols on a user-sized board. Firstly, it works for `n x n` but when I want to convert `m x n` I can't get expected result. It works for some tryings but not for all. For example:...
you are the experienced. what's your advice which one should I use?
I generally prefer usage const after type. I mean like int const &a. As far as I read, it makes more sense. But, what about declaration and definition of operator overloading. Which one should be...
I can't see where is my wrong about it. Because I have used like that. Could you improve my wrong?
Firstly, when I enter 9 as row and 8 as column I get malloc freeing error. Secondly, I get 0 as output I can't see what I enter. I want to write the program because I can reinforce rule of three....
I've written a class which name is Month. As taking a number and assinging to month variable works well. But, If I enter first three letter of month, it doesn't work as expected. Is my calling...
I know call by reference and call by value. My question is that swap function has already been invoked by reference. So, why also need sort function by reference ?
The code sorts 3 numbers in ascending order. But, swap function has already been invoked by reference. Why must also sort be invoked by reference ? I'm confused. Secondly, cout << endl, doesn't give...
hey timmy, the codes have been written by me. Do you think I'm lying ? Just I'm stuck on first_occurrence to track char by char. i.e. abece.
function invoked recursively and stop at null character....
I've written two code recursively one of them find index of first character appearance. Other one is that find index of last character appearance. I've written but I'm confusing. Can someone explain...
Dear Nominal Animal,
Firstly, you must know that you are my luminary about programming. I'm studying computer engineering and taking unix system programming course in this term. (I wanted to write...
my scheme was wrong in my first post. here is right scheme:
Every folder should be parent of files. The files are included by the folder.
14065
It counts total number of words in files. (i.e. txt). Now, I want to use multiple fork() to access and read every file. I studied in the last week. Besides, I use global variable to hold number of...
thank you Nominal Animal. So so much. I have started studying to understand step-by-step. When I got it I will write again. If I stuck, I want to pick your priceless ideas.
Can you give an example, because I don't understand mentioned logic.
"where you set the current state (e.g., using an enumeration of possible states and a variable thereof), and depending on the...
new code to check
for ( ;; )
{
int ch = fgetc(inp1);
if ( ch == EOF )
{
break;
thank you for your help. it is my first step, i want to learn using fork(), there I want to create children from just one parent , I will explain it a new topic, the second step is after making forks...
I'm trying to read files, count words in the files and go in directories. The problem is how I return numbers of total words and total directories. When it comes to nftw(), I am little confused.
...
wow. great thank you. I succeed. However, Can I use fork() for every opening file? I mean, Can I make them using fork() for every reading file ? by using ntfw() ?