Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
a4fdd03c
Unverified
Commit
a4fdd03c
authored
Aug 06, 2024
by
Daniel Hiltgen
Committed by
GitHub
Aug 06, 2024
Browse files
Merge pull request #6207 from dhiltgen/sparse_win
Ensure sparse files on windows during download
parents
86b907f8
fc85f50a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
server/download.go
server/download.go
+3
-0
server/sparse_common.go
server/sparse_common.go
+9
-0
server/sparse_windows.go
server/sparse_windows.go
+16
-0
No files found.
server/download.go
View file @
a4fdd03c
...
...
@@ -216,6 +216,9 @@ func (b *blobDownload) run(ctx context.Context, requestURL *url.URL, opts *regis
return
err
}
defer
file
.
Close
()
if
err
:=
setSparse
(
file
);
err
!=
nil
{
return
err
}
_
=
file
.
Truncate
(
b
.
Total
)
...
...
server/sparse_common.go
0 → 100644
View file @
a4fdd03c
//go:build !windows
package
server
import
"os"
func
setSparse
(
file
*
os
.
File
)
error
{
return
nil
}
server/sparse_windows.go
0 → 100644
View file @
a4fdd03c
package
server
import
(
"os"
"golang.org/x/sys/windows"
)
func
setSparse
(
file
*
os
.
File
)
error
{
return
windows
.
DeviceIoControl
(
windows
.
Handle
(
file
.
Fd
()),
windows
.
FSCTL_SET_SPARSE
,
nil
,
0
,
nil
,
0
,
nil
,
nil
,
)
}
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