linux

Library for playing Audio files in Linux C

I want to play audio files using my C programs in Linux. Can any one suggest me good development libraries for playing audio files in Linux? ...

Python Fuse calling 'readlink' 6 times in a row

I am implementing a filesystem using Python Fuse. A directory contains only symlinks and as such I return S_IFLNK | 0777 on the getattr method. Now, when I do an ls on the directory, I notice that Linux calls readlink method 6 times in a row for each entry in the directory. Is it a bug on my side or a normal behavior? ...

Python Watch Folder - interrogating list for filesize

Hi All, I'm trying to get the following code to watch a folder for changes and return the filename (preferably a full path) as a string once it's checked that the filesize hasn't increased recently, to stop the rest of my script inspecting incomplete files. I'm having difficulty with sending my filesize timer function a filename because ...

Problem running eclipse under fedora core 13 x86_64 - runs and exits without even a splash screen

When I try to run eclipse under Fedora core 13 x86_64, eclipse seems to run and then exit without an error. My install consisted of downloading this file from the Eclipse Amazon mirror: eclipse-jee-helios-linux-gtk.tar.gz untarring it in my home dir, cd'ing into the reulsting eclipse dir and running the eclipse executable. The executa...

Edit shell script while it's running

Can you edit a shell script while it's running and have the changes affect the running script? I'm curious about the specific case of a csh script I have that batch runs a bunch of different build flavors and runs all night. If something occurs to me mid operation, I'd like to go in and add additional commands, or comment out un-execut...

Tracing linked libraries

I'm getting some errors which make me think that my Linux program isn't linking to the libraries it's supposed to. How can I get the full path to all linked libraries? I know ldd will give me the names, but how can I use that to get the full path? Thanks. ...

Connect to MS Access database from php

Long story: I need to connect to mdb stored on a separate windows computer from php running on apache2 on linux. I guess odbc is the way. But the only available driver, libmdbodbc, seems to be buggy, dying randomly at odbc_fetch_row after successful odbc_exec - and taking php with it. Moreover, I'm not sure how well it handles concurrent...

Eclipse 3.5+: Loading plug-ins from auto-created .eclipse directory inside user's home directory

I have downloaded the latest Eclipse (3.6) for my Linux machine and extracted tar.gz to the /opt/eclipse directory as root. I started Eclipse as a normal user and successfully installed some plug-ins through Eclipse. The plug-ins are visible under "Installed software" from Eclipse, but they doesn't seem to be working - no new perspective...

ftell on a file descriptor?

Is there a way to do what ftell() does (return the current position in the file) on a raw file descriptor instead of a FILE*? I think there ought to be, since you can seek on a raw file descriptor using lseek(). I know I could use fdopen() to create a FILE* corresponding to the file descriptor, but I'd rather not do that. ...

How to specify timezone in linux using C

Hi, I was trying to set the timezone of my system, and was trying to use settimeofday(), which takes a timezone struct as an argument, but just read that that struct is now obsolete (http://linux.about.com/library/cmd/blcmdl2_settimeofday.htm) How could I go about doing this? Thanks in advance. EDIT: Ugh, I feel really stupid. I crea...

Dbus python and suspend with lock screen

Hi, I was wondering and also try to do it, how to lock and suspend computer using dbus interface. I am able to suspend system using org.freedesktop.UPower with method Suspend(). I also am able to lock system using org.gnome.ScreenSaver with method Lock(). But how to do it at the same time? Is it good way to use signal Suspend ? or the...

How to ignore undefined symbols at runtime in Linux?

I know that by default undefined symbols are ignored at compile time. However, I would also like them to be ignored at run-time. I need to distribute a .so that will run with and without MPI. I will know ahead of time if it is an MPI job and if it is not I won't make any MPI_* calls. If it's not an MPI run I need the application to not c...

gcc -O4 optimization flag

What's the meaning of the -O4 optimization flag in gcc (3.2.3)? What's the difference to O3? When would you use one vs. the other? The man pages only mention O, O0-3, Os, no word of the mysterious O4. Thanks! ...

How to get the CPU information of a process in Linux?

In my server, there exists several CPUs (0-7). I need run parallel code, and each process affiliate with one CPU, so how do I know the CPU information for each process? For example, if two processes (#0 and #1) exist, and process #0 uses CPU 5 and process #1 uses CPU 7. how do I know that by programming in C or Fortran? ...

PONG Response to PING - Simple IRC Bot

I am writing a simple IRC Bot in C++. I am having issues, however, parsing "PING" properly. I cannot seem to extract the "PING" string from the output. I have a sample program setup (statically) with the same setup as my IRC bot and I can parse the string, but it does not seem to write properly when I actually apply the method to the bot...

Approaches to embedded vector images/charts into PDF

How have people from the Linux world embedded vector images into PDF? I am attempting to create automated reports from data that I currently render as SVG images. Ideally, I would like to use the same XML in PostScript, PDF or DjVu format. To what degree are those formats able to handle SVG natively? More broadly, what have people's ex...

ASP.NET on ubuntu

Hi, I am waiting on my windows 7 to arrive and I am forced to use Ubuntu for the time being. I have tried using mono-project but I can't seem to find where to actually run and display my web pages. ...

How to control access right on a SCSI disk in Linux?

I'm trying to lock a SCSI device (a shared storage disk) using ioctl but I can't find a highlevel API for this and I'm not sure which commands to use. Basically I want to be able to do the four operations mentioned here: http://docs.sun.com/app/docs/doc/816-5177/mhd-7i?l=en&n=1&a=view (See: Non-shared multihost disk). I already h...

Whats the relation between a linux OS and a kernel?

Ive been using linux for several years, but never stepped beyond installing from cd/dvd and if the app manager dint have what i was looking for in software then i was a lost case. but right now im trying to get a grip around whats "linux"? first word that pops into my head is "kernel". after reading on wiki i understand that kernel is ...

expect command - Unix

Hi, I am using 'expect' to automate ssh password authentication. When I run the script in SunOS, I find the spawned ssh process gets killed once the below script is completed. This is not the case in Linux. How do we avoid it? Should we ignore the SIGCHLD signal somehow? Is there anyway to determine through this script if spawned proces...