Thread: Gnome background-changing program

  1. #16
    Use this: dudeomanodude's Avatar
    Join Date
    Jan 2008
    Location
    Hampton, VA
    Posts
    391
    Mine's in /usr/bin too.

    So best bet is to use system() with absolute path?
    Ubuntu Desktop
    GCC/G++
    Geany (for quick projects)
    Anjuta (for larger things)

  2. #17
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    That's probably what I would do -- it's unlikely that anyone would be able to overwrite /usr/bin/gconftool-2. If they can, you have more serious problems.

    But if you do hard-code the path, you might run into this sort of problem: http://linux.derkeiler.com/Newsgroup...5-05/1129.html

    You know what I would do? If it's just a program that you're planning on running on your computer, hard-code the path. If you want to distribute it, or feel like a challenge, use execl() with a list of paths like /usr/bin, /opt/gnome/bin/ and so on . . .

    Or execute another command like whereis to find all instances of that program in the path, and pick one that starts with /bin or /opt. Or check the directory where the program is located to see if it's owned by root, or at least if it's writable by anyone or not.

    Or maybe I'm overcomplicating things. Yeah, you should probably just hard-code the path.

    Also see: http://www.google.ca/search?hl=en&q=...e+Search&meta=
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. changing the background color
    By hiya in forum Windows Programming
    Replies: 10
    Last Post: 05-02-2005, 02:35 PM
  2. background program
    By wierdperson in forum Linux Programming
    Replies: 1
    Last Post: 06-27-2003, 06:25 AM
  3. Cannot run program in background?
    By registering in forum Linux Programming
    Replies: 3
    Last Post: 06-16-2003, 05:47 AM
  4. Mdm background program from VS
    By WebSnozz in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 11-23-2001, 07:18 PM
  5. Running program on background?
    By Couhilin in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 11-03-2001, 07:50 AM