I have been tring to downgrade a winNT machine to win98(I need tio use my USB webcam).I have formatted my drive and tried multiple 98 installation,but I always end up with
C:\Windows\system\vmm32.vxd: Missing/unable to load.
I dont have any scanners etc connected to my PC.The peripherals are...
Brent,
Each executable is limited to a specific default size by the OS. When you dlopen() a library your executable's memory requirements increase by the size of the library. I think your program is running out of memory.
This max size per executable can be increased by the executable. In...
getdents() offers a relative fast solution.
otherwise you can try something like
fopen("my_filename","r")
if it succeeds my_filename is present,otherwise it is not. To make the code even faster you can use the stat() system call.
cheers
amit
crazy_indian@lycos.com
to...
If you are using a UNIX clone you cna use signal handling to create a timer. One way is to use the alarm() call.
The alarm() system call instructs the alarm clock of the calling process to send the signal SIGALRM to the calling process after the number of real time seconds specified by sec...
You can also refer to the streamio man page. If your OS doesnt have one you can read it from
http://www.cs.princeton.edu/cgi-bin/man2html?streamio:7I
cheers
amit
crazy_indian@lycos.com
to bug is human to debug devine
Tyler,
Try out something like this
export str="1"
export filename="xx"
echo $str "is value of string"
echo $filename "is value of filename"
grep $str $filename
The script set the value of variables str and filename, you can replace it with your own...
...to print the line number, I tried the ed command but I coudn't make it work. A star for you.
How about
pr -n -t data.file|sort -k 3 | sed s/^[0-9]* /""/g
(Not tested)
We can remove the -k 1 for some more optimisation and replace awk by sed so we can handle a variable number of...
I dont think you are missing any trick,you have to go the hard way.
You have to write your own sorting finction which uses the second parameter i.e. A,A,B,B,D etc as primary keys and the linenumber of each of them as the secondary key.
amit
crazy_indian@lycos.com
to bug is human to debug...
The count of the number of files can be written to a flat file by redirecting the output of the wc -l command
i.e something like
wc -l >/mydir_my_filename
amit
crazy_indian@lycos.com
to bug is human to debug devine
We have to free the memory allocated to name seprately with a
free(e->e_name)
But we have to ensure we call this free before we call the free(e)
amit
crazy_indian@lycos.com
to bug is human to debug devine
Anjanku,
I would say that you should be a little bit carefull about the return values of sytem calls in Linux. Linux is currently not compliant with the standards and its errno policy is quite different from traditional UNIXes.
The best way is to read the man pages. And yeah echo $? will give...
...more examples open the /usr/include/stdio.h file. And check out the definitions of file operations.printfs etc.
e.g.(from stdio.h)
extern FILE *fopen(const char *, const char *);
extern FILE *freopen(const char *, const char *, FILE *);
When you include a header file you also include...
The above script looks conceptually correct. It could be optimised by moving the file(mv) rather than copying the file(cp)
Mountainbiker,
Are the other files index.html etc in a different directory structure ? According to the above script if you have two index.html in two differnt...
Check if your library has the itoa() function. If it doesnt you will have to write your own version or download it from the web.
cheers
amit
crazy_indian@lycos.com
to bug is human to debug devine
This should be an easy task. The code would look something like this...
main() {
char *buffer[LINE_MAX];
FILE *fp_r,*fp_w;
fp_r=fopen("filename","r");
fp_w=fopen("destination","w");
while ( fgets(fp_r,LINE_MAX,buffer) != NULL) {
if(...
There is a hack that you can probably use. This is very hardware and compiler specific so the code wont be portable. And it will work only if the pointer has not been moved around.
Hack
malloc() normally stores the size of the allocation one word before the start of the array. i.e if malloc()...
Delorie is technically not a compiler. It is a development system/environment which uses the underlying gcc compiler to compile your source code.
You can safely assume that cc and gcc are the same thing.
cc is the traditional C compiler on UNIX machines. The GNU C compiler(which you are using)...
You have to really debug your code and see what the varaiable 'array' is assigned at the time of doing the malloc(), and check the value at the time of free().
If they are the same then you are most probably doing a double-free. If they are different then your variable has been corrupted by the...
Jolesen pointed out a good fact,the speed of the build.As he said you dont have to rebuild the files that haven't been modified.
In addition many compilers allow different files to be build in parallel,i.e it will create different processes to build different object files and when they are all...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.