Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitaa94e6c

Browse files
committed
Fix "Could not find part of path" errors when extracting 0 size files (#3778)
1 parent564878e commitaa94e6c

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

‎src/NexusMods.DataModel/NxFileStore.cs‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -229,32 +229,32 @@ public async Task ExtractFiles(IEnumerable<(Hash Hash, AbsolutePath Dest)> files
229229
// Capacity is set to 'expected archive count' + 1.
230230
Parallel.ForEach(files, file=>
231231
{
232+
// Create the directory, this will speed up extraction in Nx
233+
// down the road. Usually the difference is negligible, but in
234+
// extra special with 100s of directories scenarios, it can
235+
// save a second or two.
236+
varcontainingDir=file.Dest.Parent;
237+
if(createdDirectories.TryAdd(containingDir,0))
238+
containingDir.CreateDirectory();
239+
240+
#ifDEBUG
241+
Debug.Assert(destPaths.TryAdd(file.Dest,0),$"Duplicate destination path:{file.Dest}. Should not happen.");
242+
#endif
243+
232244
// Create empty files as empty
233245
if(file.Hash==EmptyFile)
234246
{
235247
file.Dest.Create().Dispose();
236248
return;
237249
}
238250

239-
if(TryGetLocation(file.Hash,
240-
outvararchivePath,outvarfileEntry))
251+
if(TryGetLocation(file.Hash,outvararchivePath,outvarfileEntry))
241252
{
242253
vargroup=groupedFiles.GetOrAdd(archivePath, _=>newList<(Hash,FileEntry,AbsolutePath)>());
243254
lock(group)
244255
{
245256
group.Add((file.Hash,fileEntry,file.Dest));
246257
}
247-
248-
// Create the directory, this will speed up extraction in Nx
249-
// down the road. Usually the difference is negligible, but in
250-
// extra special with 100s of directories scenarios, it can
251-
// save a second or two.
252-
varcontainingDir=file.Dest.Parent;
253-
if(createdDirectories.TryAdd(containingDir,0))
254-
containingDir.CreateDirectory();
255-
#ifDEBUG
256-
Debug.Assert(destPaths.TryAdd(file.Dest,0),$"Duplicate destination path:{file.Dest}. Should not happen.");
257-
#endif
258258
}
259259
else
260260
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp