File already exists error while creating briefing.sqf #21

Closed
will-hart opened this Issue Dec 22, 2014 · 2 comments

Comments

Projects
None yet
1 participant
@will-hart
Owner

will-hart commented Dec 22, 2014

Reported through anvilsentry, stack trace to follow.

@will-hart will-hart self-assigned this Dec 22, 2014

@will-hart will-hart modified the milestone: 7.x Dec 22, 2014

@will-hart

This comment has been minimized.

Show comment
Hide comment
@will-hart

will-hart Dec 22, 2014

Owner
IOException
The file  'C:\Users\XXX\Desktop\XXX.Altis\briefing.sqf' already exists.

MS.Internal.Threading.ExceptionFilterHelper in TryCatchWhen at line 2:0
System.Object TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
System.Windows.Threading.ExceptionWrapper in InternalRealCall at line 146:0
System.Object InternalRealCall(System.Delegate, System.Object, Int32)
System.Runtime.CompilerServices.AsyncMethodBuilderCore in <ThrowAsync>b__0 at line 0:0
Void <ThrowAsync>b__0(System.Object)
AnvilEditor.MainWindow+<ExportMissionFiles>d__d in MoveNext at line 816:0
Void MoveNext()
AnvilEditor.FileUtilities in SafeDirectoryCopy at line 156:0
Void SafeDirectoryCopy(System.String, System.String)
System.IO.FileInfo in CopyTo at line 53:0
System.IO.FileInfo CopyTo(System.String)
System.IO.File in InternalCopy at line 130:0
System.String InternalCopy(System.String, System.String, Boolean, Boolean)
System.IO.__Error in WinIOError at line 230:0
Void WinIOError(Int32, System.String)
Owner

will-hart commented Dec 22, 2014

IOException
The file  'C:\Users\XXX\Desktop\XXX.Altis\briefing.sqf' already exists.

MS.Internal.Threading.ExceptionFilterHelper in TryCatchWhen at line 2:0
System.Object TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
System.Windows.Threading.ExceptionWrapper in InternalRealCall at line 146:0
System.Object InternalRealCall(System.Delegate, System.Object, Int32)
System.Runtime.CompilerServices.AsyncMethodBuilderCore in <ThrowAsync>b__0 at line 0:0
Void <ThrowAsync>b__0(System.Object)
AnvilEditor.MainWindow+<ExportMissionFiles>d__d in MoveNext at line 816:0
Void MoveNext()
AnvilEditor.FileUtilities in SafeDirectoryCopy at line 156:0
Void SafeDirectoryCopy(System.String, System.String)
System.IO.FileInfo in CopyTo at line 53:0
System.IO.FileInfo CopyTo(System.String)
System.IO.File in InternalCopy at line 130:0
System.String InternalCopy(System.String, System.String, Boolean, Boolean)
System.IO.__Error in WinIOError at line 230:0
Void WinIOError(Int32, System.String)

will-hart added a commit that referenced this issue Jan 2, 2015

Fix briefing.sqf "already exists" error
Refactor function to make var names clearer.
Close #21
@will-hart

This comment has been minimized.

Show comment
Hide comment
@will-hart

will-hart Jan 2, 2015

Owner

Well this is embarassing. My code checked for the words "already exists" on an IOException to capture instances of attempting to overwrite a file. This obviously only works where the language is English and so Czech, Spanish and other non-English users were getting this error.

Fixed by db61ec5

Owner

will-hart commented Jan 2, 2015

Well this is embarassing. My code checked for the words "already exists" on an IOException to capture instances of attempting to overwrite a file. This obviously only works where the language is English and so Czech, Spanish and other non-English users were getting this error.

Fixed by db61ec5

@will-hart will-hart closed this Jan 2, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment