Question

In: Computer Science

a) b) c) Compare and contrast systems programming in Windows as against systems programming in Unix/Linux....


a)
b)
c)
Compare and contrast systems programming in Windows as against systems programming in Unix/Linux.
CR, 8
Explain the term structured exception handling (SEH) as used in systems programming and give a practical example of how it can be used to handle errors in a block of code. AP, 7
Write a C/C++ system program to delete an unwanted file in the Windows file system. Compile and run the program and copy the source code into your answer booklet. CR,10


Solutions

Expert Solution

c. Windows   Linux

Cost The latest Windows operating system has different versions and wide range of pricing options. Most Linux distributions are free of cost (at least for private users).
Licensing model Proprietary software. The Linux kernel and most of the distributions are open source and available under a GNU General Public License (GPU).
User-friendliness From the outset, Windows was designed to be as simple to use as possible, even for users with no IT knowledge. While it’s true that Ubuntu in particular is relatively easy for Windows users to grasp, with most of the other Linux distributions, there are significant barriers to entry for newcomers.
Graphical user interface Microsoft set standards with its Windows GUI. Users of Linux distributions have many freedoms in designing the GUI and can even do away with it altogether.
Support Windows offers a large range of support services, both within the system and online. There is also comprehensive specialist literature available aimed at users with various levels of knowledge. Linux support comes from the extensive user community. You can find an answer to almost every problem in the online forums and Wikis.
Software Most software released is compatible with Windows. There are far fewer applications designed specifically for Linux, although some Windows programs can run on Linux.
Installing programs Programs are installed by downloading them from websites or from physical storage media. In Linux, the majority of programs, drivers and packages are supplied via fixed repositories.
Uninstalling programs When programs are uninstalled, some components remain on the system. In Linux, programs are always completely removed.
Hardware Windows drivers are available for almost any hardware. Hardware support is more limited. Some drivers are not available immediately.

CR 8. Structured exception handling enables you to have complete control over the handling of exceptions, provides support for debuggers, and is usable across all programming languages and machines. Vectored exception handling is an extension to structured exception handling.

#include <string.h>
#include <stdio.h>
#include<windows.h>

void foo (FILE * fileDescr)
{
char c[12];
long lSize;
int mySecretNumber;

fseek (fileDescr , 0 , SEEK_END);
lSize = ftell (fileDescr);
rewind (fileDescr);

fread(c, 1, lSize, fileDescr);
mySecretNumber = atoi(c);

__try
{
mySecretNumber = mySecretNumber / mySecretNumber;
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
printf("In the exception handler");
}
}

int main (int argc, char **argv)
{
FILE * fileDescr = NULL;

if(fileDescr = fopen(argv[1], "r"))
{
foo(fileDescr);
fclose(fileDescr);
}
}

CR 10.

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
void main()
{
   clrscr();
   int status;
   char fname[20];
   cout<<"Enter name of file, you want to delete : ";
   gets(fname);
   status=remove(fname);
   if(status==0)
   {
       cout<<"file "<<fname<<" deleted successfully..!!\n";
   }
   else
   {
       cout<<"Unable to delete file "<<fname<<"\n";
       perror("Error Message ");
   }
   getch();
}

Hope this helps you. Please give an upvote. Thank you.


Related Solutions

Consider Unix, Linux, MacOS, Android and Windows operating systems. Consider the primary application of each in...
Consider Unix, Linux, MacOS, Android and Windows operating systems. Consider the primary application of each in the marketplace. How does each OS implement threads? How does the usage of threads impact application (usage) ?
Linux Directories, File Properties, and the File System in C Understanding Unix/Linux Programming Your version of...
Linux Directories, File Properties, and the File System in C Understanding Unix/Linux Programming Your version of mv command The mv command is more than just a wrapper around the rename system call. Write a version of mv that accepts two argument. The first argument must be the name of a file, and the second argument may be the name of a file or the name of a directory. If the destination is the name of a directory, then mv moves...
. Compare and contrast the Windows password hashing algorithm and the Linux password hashing algorithm demonstrated...
. Compare and contrast the Windows password hashing algorithm and the Linux password hashing algorithm demonstrated in the book
Systems Programming in Linux using C Remake the version of the ls -ialR command in C.....
Systems Programming in Linux using C Remake the version of the ls -ialR command in C.. In this version of ls, you must also consider symbolic file types. Make sure you have file header comments and function header comments. Also, write inline comments whenever necessary.
Provide a full detailed comparison table of the differences between Windows, Solaris, Unix,Linux OS and MacOS
Provide a full detailed comparison table of the differences between Windows, Solaris, Unix,Linux OS and MacOS
Systems Programming - File Operations Create your version of the tail command in Linux using C...
Systems Programming - File Operations Create your version of the tail command in Linux using C The lseek system call allows you to move the current position anywhere in a file. The call lseek(fd, 0, SEEK_END) moves the current position to the end of the file. The tail command displays the last ten liens of a file. Try it. tail has to move, not to the end of the file, but to a spot ten lines before the end of...
What have been the major changes in the file systems for Windows and for Linux?
What have been the major changes in the file systems for Windows and for Linux?
Differences Between Linux and Windows Operating Systems Two key differences between a Linux operating system and...
Differences Between Linux and Windows Operating Systems Two key differences between a Linux operating system and a Windows operating system are the concepts of “mounting” and “drive” letters. Provide an example for each. Why is it important to plan disk partitioning before installing Linux? Discuss the advantages of disk partitioning. Also discuss what logical volume management (LVM) is and why or why you might use it.
1. Compare the Unix directory and the windows directory and answer the following: a. Match 3...
1. Compare the Unix directory and the windows directory and answer the following: a. Match 3 Unix directories to a Windows directory that is similar in function. Briefly describe their similarities and differences. b. Find a directory in Unix that appears to have no equivalent in Windows. What does it do? c. Find a directory in Windows that appears to have no equivalent in Unix. What does it do?
Contrast the behavior of windows OSs with regard to group membership concurrently with the Linux approach...
Contrast the behavior of windows OSs with regard to group membership concurrently with the Linux approach of single group membership at a moment in time. How does this approach effect cumulative group permissions in Linux?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT