Search:

Type: Posts; User: Ironic

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    1
    Views
    2,168

    help with listen and sockets.

    server: i make a listen with 5 backlog

    and then a newfd= accept...

    several clients can connect several times, trade messages and shutdown (after closing newfd)

    the problem is that if the...
  2. Replies
    6
    Views
    5,437

    pretty much as i am doing. just hoping to find a...

    pretty much as i am doing. just hoping to find a better way. tks anyway
  3. Replies
    6
    Views
    5,437

    how to delete several files at once?

    i need to delete several files at one without knowing how many are there.

    but they all start with :f ile

    ex:
    file001
    file007
    file010
    etc
  4. Replies
    4
    Views
    1,503

    problem solved. had a mistake somehere else tks

    problem solved. had a mistake somehere else

    tks
  5. Replies
    4
    Views
    1,503

    i´ve even tried the edited version of code above....

    i´ve even tried the edited version of code above. same thing happens
  6. Replies
    4
    Views
    1,503

    using select with sockets. (solved)

    exert from code: (just the essencial)


    fd_set fdset,fdsetbck;

    FD_ZERO(&fdsetbck);
    FD_SET(sfd,&fdsetbck);
    (sfd is a tcp sockect, after listen instruction)
    while(1){
    ...
  7. Replies
    9
    Views
    24,445

    problem solved. thanks

    problem solved. thanks
  8. Replies
    9
    Views
    24,445

    fp is 0x7 i can even read from the file but...

    fp is 0x7

    i can even read from the file

    but as soon i hit fseek it crashes...
  9. Replies
    9
    Views
    24,445

    fp=fopen(blkname,"rb"); also tried this. same...

    fp=fopen(blkname,"rb");

    also tried this. same error

    with fopen, fp gets the same result

    in both cases if i do fileno(fp), it crashes, but don´t why or how to fix it.
  10. Replies
    9
    Views
    24,445

    i assume you forgot a "," between o and seek:...

    i assume you forgot a "," between o and seek: fseek(f, 0 SEEK_END);

    i've tried that method but get a Program received signal SIGSEGV, Segmentation fault., in the fseek line

    FILE *fp;...
  11. Replies
    9
    Views
    24,445

    Ansi C - check file size in bytes.

    I´ve tried stat to get the file size of a certain file.
    When i run debugger i can see the st_size field with the desired size, but i cant copy it to any other variable. i´ve tried copying to int,...
  12. Replies
    4
    Views
    1,620

    dwks's suggestion worked fine. tks

    dwks's suggestion worked fine.

    tks
  13. Replies
    4
    Views
    1,620

    i have also tried writer | reader ,(writing to...

    i have also tried writer | reader ,(writing to stdout), but the behavior is strange .

    The messages are not delivered at the same speed as when the program writer is runned alone.

    Some are...
  14. Replies
    4
    Views
    1,620

    Get user commands from text file.

    I have a program that reads and executes commands from user.

    To test it well i was planning to write several commands in a text file and them send those commands one by one to the program.
    ...
  15. Replies
    13
    Views
    2,512

    tks, maybe the problem is that data is still in...

    tks, maybe the problem is that data is still in stdin.

    How can i delete remaining data in stdin, if fgets doesn read all the bytes itś supposed to?

    usual fflush(stdin) doesn't work...
  16. Replies
    13
    Views
    2,512

    yes.

    yes.
  17. Replies
    13
    Views
    2,512

    That is not the problem. What i think is that...

    That is not the problem. What i think is that when the printf is executed, the \n at the end of it, simulates the uses pressing enter, so it reads without anything been typed...
  18. Replies
    13
    Views
    2,512

    Problem with fget and simultaneous printf.

    By what i have read, fgets is the best and safest way to read a string from the user.
    The problem is that my program has a thread where a printf is executed. Is seems the \n at the end of the...
  19. thank you

    thank you
  20. Dangerous to write to same pipe from 2 or more processes?

    Title pretty much covers it.
    I have a program with a variable number of childś writing to the same pipe, from witch the father reads.
    Is this dangerous? can data be corrupted if execution jumps...
  21. Replies
    7
    Views
    2,864

    i am sure that the father only sends one message....

    i am sure that the father only sends one message.

    I have a infinite cycle in child in which it i read from pipe, and type out number of read bytes and the message.

    in the 1st cycle it prints...
  22. Replies
    7
    Views
    2,864

    Question about reading from pipes.

    I use a pipe to send an int from father to child.
    I write in father, and use read in child.

    I thought that when i read from the pipe it becomes empty, so i do another read to wait for a second...
  23. Replies
    8
    Views
    2,829

    the use of signals is good because they dont take...

    the use of signals is good because they dont take up any resources like a pipe when it is not beiing used.
    but the problem is that a signal generates an interrupt. it halts current execution,...
  24. Replies
    8
    Views
    2,829

    the problem is that signals are slow , because...

    the problem is that signals are slow , because they generate interrupts. if i had to send many commands i would slow down a lot.
  25. Replies
    8
    Views
    2,829

    What do you mean? In my pc it creates about...

    What do you mean?

    In my pc it creates about 8000 children. It's slow but it works.

    But the point of this, is what would be more efficient for larger numbers, and with a lot more powerful...
Results 1 to 25 of 35
Page 1 of 2 1 2