Find Jobs
Hire Freelancers

C Program - Simple

$10-30 USD

已完成
已发布大约 7 年前

$10-30 USD

货到付款
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 [login to view URL] starting from the beginning of the file: >partcopy 0 500 [login to view URL] [login to view URL] For instance, if the executable name is partcopy, extract 300 bytes from [login to view URL] starting at 50 bytes from the beginning of the file to [login to view URL]: >partcopy 50 300 [login to view URL] [login to view URL] 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 [login to view URL] 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: [login to view URL]:system-calls:write (with examples) [login to view URL] [login to view URL]
项目 ID: 13453142

关于此项目

6提案
远程项目
活跃7 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
颁发给:
用户头像
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. Thanks.
$20 USD 在0天之内
5.0 (35条评论)
6.1
6.1
6威客以平均价$26 USD来参与此工作竞价
用户头像
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 在1天之内
4.9 (4条评论)
2.3
2.3
用户头像
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 在1天之内
0.0 (0条评论)
0.0
0.0

关于客户

UNITED STATES的国旗
Budd Lake, United States
5.0
2
付款方式已验证
会员自3月 17, 2017起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。