0% found this document useful (0 votes)
51 views4 pages

Spring 2025 - CS609 - 1

This document outlines the requirements and guidelines for Assignment No. 01 of CS609: System Programming, due on May 2, 2025. Students must develop a Windows API-based file copy utility in C, adhering to specific submission formats and using Dev-C++. The assignment emphasizes the use of command-line arguments, error handling, and displaying file details, with strict penalties for non-compliance or plagiarism.

Uploaded by

Muhammad Asif
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views4 pages

Spring 2025 - CS609 - 1

This document outlines the requirements and guidelines for Assignment No. 01 of CS609: System Programming, due on May 2, 2025. Students must develop a Windows API-based file copy utility in C, adhering to specific submission formats and using Dev-C++. The assignment emphasizes the use of command-line arguments, error handling, and displaying file details, with strict penalties for non-compliance or plagiarism.

Uploaded by

Muhammad Asif
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Spring 2025 Total Marks:

CS609: System Programming 20


Assignment No. 01 Due Date:
02 May 2025

Instructions:
Please read the following instructions carefully before submitting an assignment. It should be
clear that your assignment will not get any credit if:

▪ The submitted assignment does not open or the file is corrupt.


▪ You have not fulfilled all the requirements described in problem statement.
▪ Assignment is copied (partial or full) from any source (websites, forums, students,
etc.). Strict action will be taken in this regard.
Submission Guidelines:

1. You must use Dev-C++ for developing this assignment. If your program does not compile
in Dev-C++ then you will get zero marks.
2. You need to upload the following file only:
(i) .C file (C language source file containing code)
3. Any other file type (.zip, .rar, .docx, .CPP, .txt, .pdf, .jpeg, .gif) shall not be acceptable and
you would get zero marks for this.

Objectives:
The objective of this assignment is to develop a simple Windows API-based file copy utility that
demonstrates the use of low-level file handling functions. You will practice working with file
paths, file attributes, and console output using Unicode-aware Windows system calls.

Topics Covered:
1 to 36
Title: File Copy with Timestamp Logging using Windows API
Assignment Statement:
Write a Windows console application in C that:
1. Accepts two command-line arguments:
o Source file path
o Destination file path
2. Performs the following tasks:
o Opens the source file using Windows API functions.
o Creates the destination file (overwrite if it exists).
o Copies the contents from the source file to the destination file using Windows
API (not C standard library).
o Retrieves and displays:
 Name of file (with extension)
 Source path
 Destination path
 The file size of the source file in bytes.
 The creation time of the source file.
 The last write time of the source file.
o Displays a success message upon completion.
Requirements and Constraints:
1. Use Windows API only for file operations (e.g., CreateFile, ReadFile, WriteFile,
GetFileSize, GetFileTime).
2. Error handling must be done using GetLastError() and displayed using FormatMessage().
3. The program must not prompt for input — all inputs must be provided via command-line
arguments.
4. The output must be displayed in the following order:
o File size
o Creation time
o Last write time
o Success or error message
5. Timestamps must be displayed in readable format (DD-MM-YYYY HH:MM:SS).
6. Use Unicode and Generic functions (e.g., CreateFileW, wmain, LPWSTR) to support
Unicode file names.

Note: How to Run Your Program with Command Line Arguments


This program requires two command-line arguments:
 The source file path (the file you want to copy)
 The destination file path (where the copy should be created)
You cannot run this program by double-clicking the .exe file, because it needs those
arguments to work properly. Follow the steps below:
Steps to Run Your Program
1. Compile the Program
Use Dev C++ to build your .exe file.
2. Open Command Prompt
 Press Windows + R, type cmd, and press Enter.
3. Navigate to the Folder Where Your EXE is Saved
For example, if your .exe is saved in:
C:\Users\YourName\Documents\Dev-Cpp\Projects\FileCopy\
Then type:
cd "C:\Users\YourName\Documents\Dev-Cpp\Projects\FileCopy\"
4. Run the Program with Arguments
Type:
filecopy.exe "C:\Users\YourName\Desktop\source.txt" "C:\Users\YourName\Desktop\copy.txt"
 Replace the file paths with real file locations on your system.
 Make sure the source file exists and the destination folder is writable.
Example Output:
File Name = source.txt
Source Location = C:\Users\YourName\Desktop\source.txt
Copied To = C:\Users\YourName\Desktop\copy.txt
File Size: 2048 bytes
Creation Time: 23-04-2025 15:21:03
Last Write Time: 23-04-2025 15:21:03
File copy completed successfully.

Note:
 You should print your student ID at the top of output screen. You will be awarded zero
marks if the student ID is missing or not yours.
 In case of any assignment related query, please do not post any question on MDB.
Contact at [email protected] for asking assignment related questions.
---BEST OF LUCK---

You might also like