Search:

Type: Posts; User: sa125

Search: Search took 0.00 seconds.

  1. Replies
    4
    Views
    1,348

    Failing to open() a file

    Hi - I'm using the open() function to open an existing file on linux. I keep getting a failure return value (-1 in this case) when trying to do so:

    int result = open("/tmp/my_file" , O_RDONLY);...
  2. Replies
    7
    Views
    1,797

    I have no idea how to do that.

    I have no idea how to do that.
  3. Replies
    7
    Views
    1,797

    I should have mentioned this was part of a larger...

    I should have mentioned this was part of a larger function. fname is a const char of the file name passed into the function. I want to know its size so I can read it using read() function later. This...
  4. Replies
    7
    Views
    1,797

    Counting Bytes in Buffer/File

    Hi - I'd like to count the bytes in a file and a fifo (linux). What's the best way to do it? This is what I did so far and got 0 (for a file who's around 80 bytes):

    FILE* f =...
  5. Replies
    13
    Views
    1,350

    Wow, and that kept me debugging for 4 hours....

    Wow, and that kept me debugging for 4 hours. Thanks for your help!
  6. Replies
    13
    Views
    1,350

    I just realized I wrote I had 3 and 4 errors in...

    I just realized I wrote I had 3 and 4 errors in the same post.. It's late here :)
    The real number is 3, and they are:
    reader.h: error: expected declaration specifiers or ‘...’ before...
  7. Replies
    13
    Views
    1,350

    MacGyver (love the 'nick) - I use eclipse on...

    MacGyver (love the 'nick) - I use eclipse on linux and compile (gcc) on every save, and I only see 4 errors that are all related to that same reader problem. So I'm not sure why you're getting more -...
  8. Replies
    13
    Views
    1,350

    And the rest.

    And the rest.
  9. Replies
    13
    Views
    1,350

    Here are 5 more.

    Here are 5 more.
  10. Replies
    13
    Views
    1,350

    I can't upload more than 5 files. So here a the...

    I can't upload more than 5 files. So here a the few that cause the issue. Thanks.
  11. Replies
    13
    Views
    1,350

    No... Didn't do the trick. Thanks though.

    No... Didn't do the trick. Thanks though.
  12. Replies
    13
    Views
    1,350

    Help - Struct Error

    I'm writing a thread pool that will contain reader threads, and am having a problem with the reader struct that I can't figure out. Please see the screen shots of my header files. The error...
  13. Replies
    5
    Views
    7,220

    I tried that but it referenced the same item in...

    I tried that but it referenced the same item in memory for all nodes. So, in my tester.c file I inserted the string "node %d" for i = 0; i < 5, and got:
    node 4
    node 4
    node 4
    node 4
    node 4
    ...
  14. Replies
    5
    Views
    2,720

    Attached is my code - I'm testing the queue in...

    Attached is my code - I'm testing the queue in the tester.c function, where the seg fault happens. Thanks!
  15. Replies
    5
    Views
    7,220

    Abstract data types in a queue

    Hello - I've written a queue and I'm trying to keep it generic as far as the data it could hold. For that purpose, my node structure is defined as such:


    struct node {

    void* data;
    struct...
  16. Replies
    5
    Views
    2,720

    Segmentation Fault in main()

    Hi - I'm fairly new to C and just wrote a very simple generic queue. I wrote a small loop to test out my queue (add 1-5 to the queue and then print it), and it works fine. The problem is that I get a...
Results 1 to 16 of 16