|
Using the skeleton below
#include <unistd.h> // read/write #include <sys/file.h> // open/close values #include <string.h> // strlen int main( int argc, char *argv[], char *env[] ) { // C++ or C code }
Write a C++ application to write the message Hello Brighton to the terminal using the Unix/Linux API only. The output should be of the form:
#include <unistd.h> //read/write #include <sys/file.h> //open/close values #include <string.h> //strlen
int main( int argc, char* argv[], char* env[] ) { for ( int i=1; i<argc; i++ ) { write( 1, argv[i], strlen( argv[i] ) ); write( 1, " ", 1 ); } write( 1, "Hello Brighton" , 14 ); }
ok, i managed to get the last question, could someone please give me an idea how to do the following?: same skeleton is used.
Write a C++ application myrm that removes (deletes) files passed as command line argument. Use only the Unix/Linux API in your program, do not use standard library functions.
Hint:
echo > File1 ./myrm File1
I've gone through several linux api tutorials and am fairly competent with c++. I would greatly appreciate any help or advice.
Dave
|