We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The *os.File returned by getOutputFile() never seems to get closed in mergeFile(). Is this a bug, or I'm using this the wrong way?
*os.File
getOutputFile()
mergeFile()
(Windows平台)用了ParallelDownload后立马os.Rename()文件会失败,提示文件正在被使用,我把parallel_download.go单独拿出来改,在mergeFile()里加上等同于defer file.Close()的代码,就可以正确使用了。 虽然os/file_windows.go的newFile()里,存在runtime.SetFinalizer(f.file, (*file).close),但还是建议可控环境下主动调用os.File.Close()
ParallelDownload
os.Rename()
parallel_download.go
defer file.Close()
os/file_windows.go
newFile()
runtime.SetFinalizer(f.file, (*file).close)
os.File.Close()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The
*os.File
returned bygetOutputFile()
never seems to get closed inmergeFile()
. Is this a bug, or I'm using this the wrong way?(Windows平台)用了
ParallelDownload
后立马os.Rename()
文件会失败,提示文件正在被使用,我把parallel_download.go
单独拿出来改,在mergeFile()
里加上等同于defer file.Close()
的代码,就可以正确使用了。虽然
os/file_windows.go
的newFile()
里,存在runtime.SetFinalizer(f.file, (*file).close)
,但还是建议可控环境下主动调用os.File.Close()
The text was updated successfully, but these errors were encountered: