linux

Will Sytem.currentTimeMillis always return a value >= previous calls?

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#currentTimeMillis() says: Returns the current time in milliseconds. Note that while the unit of time of the return value is a millisecond, the granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure...

How can I search PDF?

Hi, Im doing a small project in C++ in LINUX PLATFORM.i need to search 10 or more PDF files and find required data.how can i do so?. i will make my question more clear with following eg suppose i have ten text books all about c++ and i need info about the topic array and how i can search the pdf and find data? thanks in advance ...

What size of folders show ls -la

Possible Duplicate: When running ls -l, why does the filesize on a directory not match the output of du? Hi. I'm interesting in information what show me output ls -la in linux. So, default size is 4K. But if there are a lot of files, maybe with zero size, such as PHP sessions =), the size != 4K. What showing me ls -la? And a...

kill -9 and production application

Which problem can cause kill -9 in production application (in linux to be exact)? I have application which do some periodical work, stopping these takes long time, and I don't care if some jobs will be aborted - work can be finished by new processes. So can I use kill -9 just to stop it immediately or this can cause serious OS problem...

Executing system command in PHP differs when using browser and when using command line

Hi, I have to execute a Linux more command in PHP from a particular offset, format the result and display the result in the browser. My code for the above is: <html> <head> <META HTTP-EQUIV=REFRESH CONTENT=10> <META HTTP-EQUIV=PRAGMA CONTENT=NO-CACHE> <title>Runtime Access log</title> </head> <body> <?php $moreCom...

PHP Extension using libtidy compiles, but does not load

I wrote an extension in C++ that uses libtidy, and it runs perfectly under PHP when I compile PHP --with-tidy. However, it would be nice to have the extension run on a vanilla PHP. When I try to use the extension, I get something like: PHP Warning: PHP Startup: Unable to load dynamic library 'extension.so': undefined ...

BASH: Checking for environment variables

Hi folks, I am trying to check the value of an environment variable and depending on the value do certain things and it works fine as long as the variable is set. When it isn't though I get a whole bunch of errors (as BASH is trying to compare the string I specify with an undefined variable, I guess) I tried implementing an extra check...

Correct initialization sequence for Linux serial port

I wrote an application that must use serial ports on Linux, especially ttyUSB ones. Reading and writing operations are performed with standard select()/read() loop and write(), and there is probably nothing wrong in them, but initialization code (or absence of some part of it) damages something in the tty subsystem. Here it is: vuxbo...

Qt not displaying PNG images on Linux

Hi, I have a software written using Qt which is meant to work on both Windows and Linux. I use PNG images as icons for my QActions, embedded in a resource. I have the following tree directory: / resources/ icons.qrc image.png Here is the content of icons.qrc: <RCC> <qresource prefix="/resources" lang="fr"> <file al...

printing uid of a file on linux system

i am learning c programming. I am trying to make my own program similar to ls command but with less options.what i am doing is taking input directory/file name as argument and then gets all directory entry with dirent struct(if it is directory) . After it i use stat() to take all information of the file but here is my problem when i use...

C key pressed in Linux console

I have started to study C. I'm using Linux console and I would like to do a program which outputs random characters until ESC is pressed. How can I make such a keyboard handler? ...

How to check Linux version with Autoconf?

My program requires at least Linux 2.6.26 (I use timerfd and some other Linux-specific features). I have an general idea how to write this macro but I don't have enough knowledge about writing test macros for Autoconf. Algorithm: Run "uname --release" and store output Parse output and subtract Linux version number (MAJOR.MINOR.MICRO)...

simulating atm communication without atm switch.

Hi everyone there, can anybody tell me how to make file descriptors behave like atm nodes in /dev directory. Since i dnt have atm switch to test my program, i have to test with normal files, is there any method to make special type of file descriptors that behave like atm nodes. ...

Which mail server would you choose to develop your product on top of

I am willing to build an email application which runs on the server side. Not being familiar with any particular server I wonder if I can get some recommendations based on your experience. I look for a stable, production ready and scalable daemon, which provide an easy-to-use c/cpp api interface. I am willing to hook at the incoming ...

Shell scripting : Find file with the name 'error_log' and check sizes, remove if over a certain size

Hi guys, I am trying to create a shell script/command that find error_log files created by PHP, check their file sizes and remove them if over a certain size. I have only gotten as far as printing the files and file sizes with the code below for i in `locate -r 'error_log$'`;do echo "$i|" `stat -c %s $i`;done Can anyone help? Thank...

Can I run original MS.Net Framework 4 on Linux someway (with Wine perhaps)?

I once heard of a guy managed to install original Microsoft .Net Framework on Linux and successfully run Mono-incompatible .Net applications using bleeding-edge MS C# features. Any idea how could he do it? ...

Mercurial hg clone error - "abort: error: Name or service not known"

I have installed the latest hg package available for Fedora Linux. However, hg clone reports an error. hg clone http://localmachine001:8000/ repository reports: "abort: error: Name or service not known" localmachine001 is a computer within the local network. I can ping it from my Linux box without any problems. I can also use the...

Garbage data from serial port.

Hi I wrote a code in Linux platform that read the data in serial port, my code below: int fd; char *rbuff=NULL; struct termios new_opt, old_opt; int ret; fd = open("/dev/ttyS0", O_RDWR | O_NOCTTY); if( fd == -1 ) { printf("Can't open file: %s\n", strerror(errno)); return -1; } tcgetattr(fd, &old_opt); new_opt.c_cflag = B115200 |...

How to obtain ports that a process in listening on?

How do I get the ports that a process is listening on using python? The pid of the process is known. ...

How can I modify the application file of an application that is currently running (on Linux)?

I have an application running called AppFS. This application has an ext2 filesystem just attached to the end of the file (it's positioned so that the application binary exists in a 1MB spacing area, followed by the ext2 data). Now I've got FUSE embedded in the program and I've managed to extract the filesystem out of the application da...