Search:

Type: Posts; User: HalNineThousand

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    8
    Views
    2,083

    I prefer threading, but I found, from an earlier...

    I prefer threading, but I found, from an earlier question, that fork() is needed in creating a daemon. Now I'm working on a program that will do some audio recording, so it will execute a command...
  2. Replies
    8
    Views
    2,083

    Is fork() a resource hog?

    While reading up on fork(), I read one source that said that essentially the current process was duplicated. The wording made me think that, essentially, a duplicate of the current program was...
  3. Replies
    4
    Views
    2,537

    Using the command as the 1st and 2nd argument...

    Using the command as the 1st and 2nd argument does the trick. Thanks!

    Now is there any way to kill the process after it's been launched?
  4. Replies
    4
    Views
    2,537

    I get absolutely nothing from the error by...

    I get absolutely nothing from the error by changing the code. I did it slightly differently:


    ecode = execlp(cmd.c_str(), arg.c_str(), marg.c_str(), (char *) 0);
    cout << "Error...
  5. Replies
    4
    Views
    2,537

    Executing a Program With Arguments

    I don't know how platform specific exec() and its relatives are, but my guess is it'd have to be.

    I'm running an executable from a C++ program this way:


    string cmd = "testprog", arg =...
  6. Replies
    14
    Views
    7,375

    You mean locked as in can't delete it, right? ...

    You mean locked as in can't delete it, right?

    And I take it you mean the directory it was started from, not the one the executable was in, right?
  7. Replies
    6
    Views
    4,633

    So if I want it to block, I would have to open it...

    So if I want it to block, I would have to open it as two separate files, one for reading, one for writing, right? I need the O_NDELAY for writing, don't I?

    Even when I was opening it as two...
  8. Replies
    6
    Views
    4,633

    Sure. Code to open: bool...

    Sure. Code to open:



    bool LinuxPort::openport() { //public
    if (isOpen) return true;
    isOpen = true;
    cout << "Opening port: " << serialdevice << endl;
    portfd = open(serialdevice.c_str(),...
  9. Replies
    14
    Views
    7,375

    Okay. Makes sense. And yes, I would want to...

    Okay. Makes sense. And yes, I would want to print an error. I prefer programs that communicate too much as opposed to not giving enough info.

    Thank you!
  10. Replies
    6
    Views
    4,633

    The DTR problem is gone. I added: ...

    The DTR problem is gone. I added:


    options.c_cflag |= HUPCL;

    in setportattr() and it behaves. I had added it earlier, with other settings and it didn't make a difference. Since I'm totally...
  11. Replies
    14
    Views
    7,375

    I was hoping that you did mean run_the_daemon()...

    I was hoping that you did mean run_the_daemon() as a call to any function because I was thinking just what you suggested: use it as a subroutine, so I could put it in my personal library to make it...
  12. Replies
    14
    Views
    7,375

    When you use run_the_daemon(); Do...

    When you use


    run_the_daemon();


    Do you mean to call the actual daemon program through a system call, or do you mean to simply just call the function in this program itself? I'm assuming...
  13. Replies
    14
    Views
    7,375

    Detaching from Console

    I know I can run a program like this:

    cprog >/dev/null 2>&1 &

    and it'll basically run on its own and it is essentially detached from the console so I can go ahead and use the console for other...
  14. Replies
    6
    Views
    4,633

    Serial Port Issues (again!)

    I had a few problems before with writing to the serial port in Linux and everything worked for while, but now, after everything else is done and I'm checking over all the functions, I'm running into...
  15. Replies
    5
    Views
    1,119

    Okay, yes, I've done something like that with...

    Okay, yes, I've done something like that with vectors. I was just wondering if there were something I was totally clueless about that would let me return two items at once. The only language I know...
  16. Replies
    5
    Views
    1,119

    Returning Multiple Tuples?

    I'm pretty sure the answer to this is no, but as I dig into C++ I keep finding things that surprise me.

    I know I can return an object that could contain just about anything (or pointers to...
  17. The reason it's done in multiple objects is...

    The reason it's done in multiple objects is because of file size, essentially. There's a lot of code for the part of the program that sends commands to the radio and a lot for the part that listens...
  18. Yeah, I was thinking that, as well. I can either...

    Yeah, I was thinking that, as well. I can either put a huge number of function calls in the main class or use forwarders or go with just a few calls and specifying the function as an argument, for...
  19. Passing A Function From One Object to Another

    I have a control class that interacts with hardware attached to the computer. That includes a large number of function calls for performing actions (like turning it on or off, specifying settings,...
  20. I wish I still had the examples, but in the...

    I wish I still had the examples, but in the interest of just getting things working, I used default constructors and put in some getters and setters to pass on the objects once it was constructed. ...
  21. So if I include the parameters needed, it is...

    So if I include the parameters needed, it is still creating a temporary version of objb until I create the one I actually intend to use?
  22. Construstors: Called When and How in Other Objects?

    I'm having trouble understanding when constructors are called from within another object. I've been told it's best to declare (or is it define) an object in the header file and then include that...
  23. Yes, it does get into syntax I haven't seen...

    Yes, it does get into syntax I haven't seen before. Thanks! I'll put it into my program and I'm sure it'll take a bit for me to figure out how it works, but having a guide will let me understand...
  24. After re-reading this thread and noticing this,...

    After re-reading this thread and noticing this, then it leads to another question. In this case I was trying to pass a pointer to a function and once that function was in an object, it wouldn't...
  25. Okay, first I wanted to make sure it worked, then...

    Okay, first I wanted to make sure it worked, then I went back over the code and this explanation a few times to make sure I followed what's going on.

    I've heard for years how many people just...
Results 1 to 25 of 43
Page 1 of 2 1 2