Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
iTasks-SDK
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
83
Issues
83
List
Boards
Labels
Service Desk
Milestones
Merge Requests
10
Merge Requests
10
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
clean-and-itasks
iTasks-SDK
Commits
78c1defa
Commit
78c1defa
authored
Jan 18, 2021
by
Mart Lubbers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use copyFile instead of manually copying in Extension.File
parent
62f6b331
Pipeline
#48180
failed with stages
in 3 minutes and 22 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
22 deletions
+1
-22
Libraries/iTasks/Extensions/Files.icl
Libraries/iTasks/Extensions/Files.icl
+1
-22
No files found.
Libraries/iTasks/Extensions/Files.icl
View file @
78c1defa
...
...
@@ -30,28 +30,7 @@ moveFile :: !FilePath !FilePath -> Task ()
moveFile
srcPath
dstPath
=
accWorldError
('
SF
'.
moveFile
srcPath
dstPath
)
(
addExplanation
[
"Failed to move "
,
srcPath
,
" to "
,
dstPath
])
copyFile
::
!
FilePath
!
FilePath
->
Task
()
copyFile
srcPath
dstPath
=
accWorldError
(
copyFile`
srcPath
dstPath
)
(\
e
->
concat
[
"Failed to copy "
,
srcPath
,
" to "
,
dstPath
,
": "
,
e
])
copyFile`
::
!
FilePath
!
FilePath
!*
World
->
(
MaybeError
String
(),
!*
World
)
copyFile`
srcPath
dstPath
w
#
(
ok
,
srcFile
,
w
)
=
fopen
srcPath
FReadText
w
|
not
ok
=
(
Error
(
"cannot open "
+++
srcPath
),
w
)
#
(
ok
,
dstFile
,
w
)
=
fopen
dstPath
FWriteText
w
|
not
ok
=
(
Error
(
"cannot open "
+++
dstPath
),
w
)
#
(
srcFile
,
dstFile
)
=
actuallyCopy
srcFile
dstFile
#
(
ok
,
w
)
=
fclose
srcFile
w
|
not
ok
=
(
Error
(
"cannot close "
+++
srcPath
),
w
)
#
(
ok
,
w
)
=
fclose
dstFile
w
|
not
ok
=
(
Error
(
"cannot close "
+++
dstPath
),
w
)
=
(
Ok
(),
w
)
where
actuallyCopy
::
!*
File
!*
File
->
(!*
File
,
!*
File
)
actuallyCopy
src
dst
#
(
end
,
src
)
=
fend
src
|
end
=
(
src
,
dst
)
#
(
s
,
src
)
=
freads
src
65536
#
dst
=
dst
<<<
s
=
actuallyCopy
src
dst
copyFile
srcPath
dstPath
=
accWorldError
('
SF
'.
copyFile
srcPath
dstPath
)
(\
e
->
concat
[
"Failed to copy "
,
srcPath
,
" to "
,
dstPath
,
": "
,
e
])
createDirectory
::
!
FilePath
!
Bool
->
Task
()
createDirectory
path
False
=
accWorldError
('
SD
'.
createDirectory
path
)
(
addExplanation
[
"Failed to create directory "
,
path
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment