I have a requirement, to read the complete proc filesystem from the linux pc.. Does linux provide some functions to read the proc filesystem means the directories and files present in the filesystem.. in short I want to create a treeview of proc filesystem. and if a user selects the file in the proc.. I should show the contents in the respective file. So I want some library or functions to read the proc filesystem..
I'm reading about shared, static, and dynamic libraries. What is SDL? Is it static, shared, or dynamic?
I always thought a library would be a lot of .h and .cpp files compiled separately into .o files and then if you compiled your own program you could use the -l parameter to link the library and it was all compiled together. Now I'm not so sure.
I don't even see any SDL .cpp files in my system anywhere. All I have are lots of SDL .h files in /usr/include/SDL and I don't really understand the code in them.
I'm making a wild guess here: SDL is a shared library. SDL itself is NOT compiled into my program, therefore SDL must be on any system my program tries to run on. When I compile and link SDL all it needs is the header files to know what SDL function and objects it can use. And then on every system it uses an already compiled SDL shared library thingy somewhere.
So... where is that part of SDL? All I can find are header files.
I'm thinking the advantage of shared libraries is that someone could say update SDL on their own system and take advantage of the new features without having to download new executables with the new version of SDL compiled into them for every program that uses SDL.
So if I'm making an editor and a game engine and they both use a lot of the same .cpp and .h files that I wrote and I'm tired of updating one and then the other and I need to turn them into a library, then a shared library might be kind of a silly solution. I could just make a static library. Right? Because it's not SDL. Nobody else is ever going to use this library.
How can we convert a dynamic library (filename.so) to a static library (filename.a) using gnu gcc . Can we get a static library form a dynamic library . I saw a few post in which the conversion form a static library to a dynamic library is mentioned but, unfortunately, not the other way.
None of my daemon scripts work now, and the startup process displayed errors. Should I reinstall the OS and start from scratch, or is there a way to recover these files? Is there a way to rebuild the files I deleted?
I have problem to use an alias that defined in ksh93 script,in the functions in the same script onm Linux.I definied an alias in main: alias echo='echo -e' in order that echo will read backslashes but when i executed it in function, the alias didnt work, and performewd a regular echo, without -e
cat test.ksh #!/bin/ksh alias echo='echo -e' checkUsage
have an application where from time to time I need to check the db for some value and run some functions to do some checks. is the best option do it as php daemon or cron job?Whatworried of cron job is the overalapping.
Im implementing a chat application using Jabber/XMPP and gloox framework which should send and receive messages concurrently in Ubuntu Linux.
The problem faced is both the threads are created and pthread_join( ) is called for both.The iSend thread is scheduled first but gets suspended at cin. Once the recv( ) function is called, which runs in iRecv thread, the recv call back function handleMessage( ) is called. However the control never shifts back to the iSend thread which should call SendMessage( ) function.
I am trying to write a simple program in C that involves nesting switches. For example switch 1 offers an option to go to module 1 or 2 or quit. when I go to module 1 there is another switch function offering two or more choices.
I can select either module 1 or 2 at the start of the program and the selection text for, say, module 1 prints to screen but then exits without allowing a second selection to be entered.
I tried using free([first selection]) thinking that might do the trick but it doesn't.
Is it possible to next switches on after another in C?
But I would like to avoid this approach as there are a lot of places in my program where I would have to make this change. Can I perhaps rebuild the pthreads library on macos without affecting other apps ?
I feel like there should be a cleaner way of doing this. I have one file, for example "a.cpp", calling a function from another file, "b.cpp". Currently I have it set up so that header for "b", "b.h", has the declaration of its functions. And then I'm just including "b.h" in "a.cpp". Do I have to include the "b" header file in "a" to be able to call a function from "b"? Or is there a better way I could be doing this? Like doing something different at compile?
I've encountered a problem when running a simple bit of code, I'm using c to read write data to a binary file. It works fine when I run as root. However when I run as a user it produces the file, however when I try to open / write after it's produced it caused a seg fault. Is there any reason file functions ( fopen etc ) would work for root and not a user and is there a way to fix this?
I'm trying to call some kernel functions from userspace, but I'm not sure if I'm doing it right. The functions control a pulse width modulator on an embedded platform. To pick one at random, the function:
Code: struct pwm_device *pwm_request(int pwm_id, const char *label); is defined in linux/pwm.h, and the implementation uses the macro EXPORT_SYMBOL(pwm_request), so I should be able to call this from user-space... right?
Anyway, I've got linux/pwm.h to #include in my source so the compiler knows what it's doing, but what do I link against? The only place in by kernel build tree where I can see a symbol pwm_request defined is in object files like vmlinux.o, built-in.o in the directory, etc. which I don't think I should be linking against.
My distribution is Fedora 12. When I want to get the infos of kernel functions such as printk, i type man printk, failed. I look up some articles and learn that in some distributions the kernel functions is in section 9 of man page. Then i type man 9 printk also no reply. How can i get man pages of kernel functions ?
So if you are a PHP-programmer (average one) and code for money, how many of funtions and operators of PHP should you remember by heart (in real life)? I was looking through php.net and man there are millions of tons of them!
I have created a glade file which so far have two regions in it:
1) On the right division is a toggle button which calls a C script when enabled.
2) I have a drawing area, in which I would like to plot a point (X-Y scatter plot). The plot should be generated dynamically using a C script. I am not sure how the integration between the two is possible for a drawing area.
In glade what properties of drawing area should I set? eg.expose event, realize etc. I was thinking of using cairo for generating the plot.
So I'm teaching myself some scripting to try and create a fairly simple photobooth type affair... I've got gphoto2 playing fairly nicely with my canon, and imagemagick taking that output and rearranging it to a vertical format...
EDIT: *smacks forehead*
Fairly simple to do what I needed initially: Code: feh -FZ -D 1 --cycle-once $COUNTDOWN & sleep 2 & feh -FZ -D 20 --cycle-once $SMILE This shows a countdown from 5 to 1 in images and $SMILE is big that says 'smile'
So my question is thus... (fairly basic but I can't get my head round the use of & and sleep in this context) what's the best way to call my gphoto instructions (or a script with them in) mid way through the above code?!
'feh code' sleep 5 'gphoto code'
this kind of thing seems like the way, but the'sleep 5' and 'gphoto code' doesn't start until feh is finished in this case?
I have this project which I've been working on essentially nonstop for the past three days and due to work I am running low on time. I'm new to Linux/Unix and my Teacher has assigned us a scripting project, due for Monday. I have All the functions for the project in a separate file which run as a daemon process when I log in. It has no syntax errors but my Script can not run the functions (I'm not sure where they go before or after the body) and I have one function I'd like you guys to take a look at. It has a Second menu leading to a case statement but it does not run after the Search. I'm Kinda tired of looking at the CLI but I have to finish this.