unix

size of _POSIX_PATH_MAX

Is size of _POSIX_PATH_MAX is same for all unix flovors(linux,solaris).. ...

can JMS used in Java Swing App

I need to design a Swing application, which will need to send out multiple jobs as customer requested. each job is running the same shell scripts which will take 10-30 mins to return a value. (the jobs are not running on application server or as web services. )then the Swing application will need to decide what to do next according to th...

How to output to a file with information from a pipe in C?

I'm confused about what I'm doing wrong when I'm attempting to output to a file after I've execed a second program. Say I have input file that has the following names: Marty B. Beach 7 8 zachary b. Whitaker 12 23 Ivan sanchez 02 15 Jim Toolonganame 9 03 After my programs finish, it will convert the student's names to their...

Using Textmate "MATE" command remotely.

Is it possible to edit files on a remote machine using the MATE command to work on a project / directory locally? ...

[C - open()] How to calculate the bit flags/enum flags for oflag in open()?

I'm working on a networking assignment and we are tasked with creating a remote file access server with a protocol we were given. My difficulties come in the lack of information I can find that explains the process of calculating the bits for the oflag argument in open(). I receive a message from a client to open a file and in the messa...

Good linker documentation needed!

I need to write a little library, to be loaded by setting LD_PRELOAD, and which will override some functions in the standard C library but also call those functions in the standard library. Specifically, I want my shiny new library to let users provide their own resolv.conf so they can, eg, specify their default domain, or set aliases i...

mac unix script problem

I'm trying to write a script that breaks up a VERY large file into smaller pieces that are then sent to a script that runs in the background. The motivation is that if the script is running in the background, I can run in parallel. Here is my code, ./seq works just like the normal seq command (which mac doesn't have). and $1 is the huge...

what webserver / mod / technique should I use to serve everything from memory?

I've lots of lookuptables from which I'll generate my webresponse. I think IIS with Asp.net enables me to keep static lookuptables in memory which I can use to serve up my responses very fast. Are there however also non .net solutions which can do the same? I've looked at fastcgi, but I think this starts X processes, of which anyone c...

C program cross platform Differences on windows and Unix OS

Is there any difference in C that is written in Windows and Unix. I teach C as well as C++ but some of my students have come back saying some of the sample programs does not run for them in Unix. Unix is alien for me. Unfortunately no experience with it whatsoever. All i know is to spell it. If there are any differences then i should be ...

Mac OSX and Unix quick questions

I have 3 questions. I am making a C++ executable to launch a Perl program I made. I will compile it for Winows, Mac OSX and Linux. It's pretty much just: system("perl progam.pl"); When compiled with Mac OSX, the program starts in ~. How would I get it to start in the dir it was launched from, or is it just a problem with the compiler? ...

The Unreliable Signal API - Code doesnt work as expected

Basically,expected output of is that it catches KeyboardInterrupt 5 times and exits the 6th time.(If 1st line of handler() is un-commented) Now, if i comment that line too, then also the behavior of program doesnt change even though I am using unreliable API. As I have used signal() function, this is unreliable bcos after the...

What is the proper indentation for bash scripts?

What is the proper indentation for a bash script? As a java/c++ monkey I religiously indent my code. But it seems you are not allowed to indent this code: #! /bin/bash if [ $# = 0 ] then # there was no arguments => just do to standard output. echo "there are no parameters" else cat << EOF =============================...

Unix TCP servers and UDP Servers

Why is the design of TCP servers mostly such that whenever it accepts a connection, a new process is invoked to handle it . But, why in the case of UDP servers, mostly there is only a single process that handles all client requests ? ...

File Descriptor Sharing between Parent and Pre-forked Children

In Unix Network Programming there is an example of a Pre-forked server which uses message passing on a Unix Domain Pipe to instruct child processes to handle an incoming connection: for ( ; ; ) { rset = masterset; if (navail <= 0) FD_CLR(listenfd, &rset); /* turn off if no available children */ nsel = Select(maxfd...

read the last line of a fifo

Here is the situation : Some process writes lines into a fifo file (created with mkfifo). At some point in my program, I want to read the last line in the fifo, and discard all the others. The procedure may block, only if there is less than one line in the fifo. I can't come up with a clean way to do this, any ideas ? EDIT : The writi...

Proper length of an AF_UNIX socket when calling bind()

bind() needs a length of the sockaddr structure you've given it. Now, for unix sockets, sockaddr_un is used What's the proper ways of calculating the length of this when you've filled in the sun_path member ? I've seen multiple approaches: socklen_t len = sizeof(sockaddr_un); socklen_t len = offsetof(sockaddr_un,sun_path) + strlen(addr...

How to format integer correctly in c?

Say I have a text file that has multiple names and their corresponding birthdays such as: john doe 2 34 lauren doe 3 4 albert r. grifton 03 12 The converter program will make usernames for the students such as: jd0234 ld0304 arg0312 The problem I am experiencing is adding the zeros for the if/else conditions for the odd amounts o...

Using mod_mono on Solaris 10 - UNIX

Hi, I'm trying to get / compile / install mod_mono for Apache 2.2.4 on Solaris 10. Apache Version: Apache/2.2.4 (Unix) [/]# uname -a SunOS wexch 5.10 Generic_118855-36 i86pc i386 i86pc I have blastwave installed (blastwave.org), and am a little disappointed that it doesn't have a mod_mono package, or include mod_mono with other pack...

line doesn't execute in .bash_profile and .bashrc on my Mac OSX Snow Leopard

Hi, I just installed Ruby Version Manager (RVM) which is working fine but it asked me to put the following line in my /.bash_profile and ~/.bashrc files: if [[ -s /Users/tammam56/.rvm/scripts/rvm ]] ; then source /Users/tammam56/.rvm/scripts/rvm ; fi looking at the content I see the following: tammam56$ cat /.bash_profile export PAT...

Creating feed files by writing unix shell scripts.

Hi, I don't know how to create a text feed files using UNIX shell scripts? Can you please give me the sample for the same. ...