Answer to Question #315015 in C++ for NATH

Question #315015

1.   Write a Linux shell script to perform the following tasks: 

 

a.   Display current date and time 

b.   Display current working directory 

c.   To check whether a sample file is a directory 

d.   Display details of all files/directories in current working directory 

e.   To check whether a sample file is readable, writable, and executable. 

 

Provide the shell script along with the sample output screenshot. Refer to the attached rubrics as a guide. Print a copy of the rubrics to be attached with this lab report.  


1
Expert's answer
2022-03-21T12:40:28-0400
int main()
{
	time_t seconds = time(NULL);
	tm* timeinfo = localtime(&seconds);
	cout << "Current Datetime:" << asctime(timeinfo) << endl;
	char path[MAX_PATH];
	GetCurrentDirectory(sizeof(path), path);
	string path_in_string = path;
	cout << "Current Directory: " << path_in_string.c_str() << endl;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog