Em Andamento

C Program - Simple

Write a C program (partcopy) that allows a user to extract some part of an existing file (fileSource) and copy it to a new file fileTarget. The user can specify the number of bytes (num1) from the beginning of filesource, how many bytes (num2) that will be extracted from it, and the new fileTarget name.

>partcopy num1 num2 filesource fileTarget

For instance, if the executable name is partcopy, extract 500 bytes from [url removed, login to view] starting from the beginning of the file:

>partcopy 0 500 [url removed, login to view] [url removed, login to view]

For instance, if the executable name is partcopy, extract 300 bytes from [url removed, login to view] starting at 50 bytes from the beginning of the file to [url removed, login to view]:

>partcopy 50 300 [url removed, login to view] [url removed, login to view]

Note:

You need to use command line argument to acquire the num1, num2, and filetarget name. ( 5pts)

You need to use open() system call to open an existing file. Print out the error message if the filesource does not exist byusing perror() function. (5 pts)

You need to check if the size of filesource againt the sizes of num1 and num2. Print out the warning message if the file size is smaller than num1+ num2. In this case, your program will just copy the content up to the end of the source file. This is the situation that the file size is too small to copy the requested size of the content. (10 pts)

Once the filesource is open, use lseek() system call to move the file pointer to the proper location for starting reading: num1 from the beginning of the filesource file. ( 20 pts)

Create a new file fileTarget and use read() and write() system call to copy the content from filesource to fileTarget for num2 [url removed, login to view] files when extraction process is complete. 20 pts)

Thing to Submit:

A c source code partcopy.c with header, error checking including max size of file content you can copy, and documentation as comments in the program. If num1+num2 is greater than the size of filesource, your program may only copy up to the end of the file.

Testing results with screen shots to prove a working copy of executable according to the instruction. You testing cases should include proper num1_num2 and in-proper num1+num2.

The system call manual can also be accessed at the following links other then eve machine:

[url removed, login to view]:system-calls:write (with examples)

[url removed, login to view]

[url removed, login to view]

Habilidades: Programação C

Ver mais: simple program with c or java, have a psuedocode text which needs to be converted into a c code by tomorrow, create a simple program, c++ simple program, c# code to write excel rows from a nested array, c simple program, c code to write excel rows from a nested array, simple resistor color code program, simple program huffman code, simple program income tax code cpp, code ocr simple program, simple program code, leads simple insurance zip code submit cpa offer, bluej project game source code simple program, code simple program netbeans, source code simple program j2me jme, simple program vbnet, simple program java games, visual simple program, simple program read file, free simple program, simple program notepad, simple program payroll, simple program ticketmaster, simple program request accept entered information

Acerca do Empregador:
( 2 comentários ) Budd Lake, United States

ID do Projeto: #13453142

Premiar a:

LiangXiaoJin

Dear client, how are you? I am a C/C++ programmer and mathematician. No problem. Lets do. Please check my "Profile & Work List" and tell me details if my skill is in your concern. Looking forward to your response. Mais

$20 USD em 0 dias
(26 Avaliações)
3.3

7 freelancers estão ofertando em média $26 para este trabalho

cshahzad

I am an expert of C and C++ having more then 1 year experience of development. I developed many projects of different fields. I can you this job for you in a very nice way.

$25 USD em 1 dia
(1 Comentário)
0.7
$15 USD em 1 dia
(0 Comentários)
0.0
Programmer59

Hello Sir, We read your description We have lot of experience in this filed We can do that also If you want We are available for start work right now I am waiting your response Thank you so much.

$25 USD em 1 dia
(10 Comentários)
0.0
shubhamkamble123

I can do it for you in the best way you need it. So please give me this opportunity so that I can prove myself. Thanks.

$25 USD em 1 dia
(0 Comentários)
0.0
$30 USD em 1 dia
(1 Comentário)
0.0
$40 USD in 2 dias
(0 Comentários)
0.0