What does Windows error code 80 (ERROR_FILE_EXISTS) mean?

 
Could be also:
ConstantTypeOS
ELIBBADerrnoLinux
EAUTHerrnoMac
ENOTUNIQerrnoSolaris
PAGE_FAULT_IN_NONPAGED_AREABugCheck CodeWindows
Previous Next
ERROR_REDIR_PAUSED ERROR_CANNOT_MAKE

ERROR_FILE_EXISTS

The requested name is already occupied

ERROR_FILE_EXISTS commonly occurs when an API is asked to create a new file without replacing an existing one. It protects callers from accidental overwrite and is expected in race-safe create-if-absent workflows.

What to decide

  • Determine whether existing content should be reused, replaced, renamed, or treated as conflict.
  • Use the correct CreateFile creation disposition for that policy.
  • Avoid a separate existence check followed by creation; another process can win the race.
  • Validate that the existing object is a file of the expected type.

Recovery

Choose an alternate unique name, open the existing file intentionally, or request replacement only when data loss is acceptable. For lock files and one-time initialization, this result can indicate that another process already owns or completed the operation.

References


Looking for a different code? Search another status or error code.