Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tp_prog_sys_S2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
leo.muff
tp_prog_sys_S2
Commits
e856d62a
Commit
e856d62a
authored
2 years ago
by
leo.muff
Browse files
Options
Downloads
Patches
Plain Diff
started copyf
parent
58a24e4e
Branches
main
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
copy.c
+7
-1
7 additions, 1 deletion
copy.c
copy.h
+3
-0
3 additions, 0 deletions
copy.h
copyf.c
+17
-1
17 additions, 1 deletion
copyf.c
with
27 additions
and
2 deletions
copy.c
+
7
−
1
View file @
e856d62a
#include
"copy.h"
\ No newline at end of file
#include
"copy.h"
#include
<stdio.h>
#include
<stdlib.h>
int
copy
(
char
*
src
,
char
*
dst
,
unsigned
int
buf_size
){
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
copy.h
+
3
−
0
View file @
e856d62a
#ifndef _COPYF_H_
#define _COPYF_H_
int
copy
(
char
*
src
,
char
*
dst
,
unsigned
int
buf_size
)
;
int
copyf
(
char
*
src
,
char
*
dst
,
unsigned
int
buf_size
)
;
#endif
This diff is collapsed.
Click to expand it.
copyf.c
+
17
−
1
View file @
e856d62a
#include
"copy.h"
\ No newline at end of file
#include
"copy.h"
#include
<stdio.h>
#include
<stdlib.h>
#include
<errno.h>
#define MEGA 1000000
int
copyf
(
char
*
src
,
char
*
dst
,
unsigned
int
buf_size
){
FILE
*
fp
=
fopen
(
src
,
"r"
);
char
*
buffer
[
buf_size
+
1
];
while
(
fread
(
buffer
,
buf_size
,
10
*
MEGA
/
buf_size
,
fp
)){
if
(
ferror
(
fp
))
{
printf
(
"Error occured while reading file."
);
return
-
1
;
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment