Find the answer to your Linux question:
Results 1 to 2 of 2

Thread: netcat in c

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    netcat in c

    hey guys, i'm using netcat as sending client application:

     nc -c 7331 < testfile
    nc -l -p 7331 > received_testfile
    so far so good-->that works quite well


    i wrote an C Porgram where i use the exact same command:
    system("nc -l -p 7331 > received_testfile")
    but here, the file I created is always empty

    someone got an idea where i could start searching?

  2. #2
    wow...funny how things are working out....searched for hours, and minutes after writing into a forum....

    the problem was the loop
    system("nc -l -p 7331 > received_testfile")
    the code received the file just fine, but after that it openend the same file again for writing into it-->clears the file

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts