KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: "File already exists" error when creating or modifying a document
PRODUCT: 4D | VERSION: 14.1 | PLATFORM: Win
Published On: June 5, 2014

Creating and/or modifying documents to a location can cause the error “The file already exists” even if the file does currently exists in the destination directory. This error may occur because the user is trying to create a document in a system folder without the proper permissions.

For example, the code below can cause this error:

C_TEXT($src;$dest)
$src:="C:\\Users\\Username\\Desktop\\MyText.txt"
$dest:="C:\\Windows\\"
COPY DOCUMENT($src;$dest)




The following commands may cause "The file already exists" error:
  • COPY DOCUMENT

  • MOVE DOCUMENT

  • CREATE FOLDER


Thee commands below may cause an "Access denied" error when trying to edit or create files in a system folder:
  • DELETE DOCUMENT

  • DELETE FOLDER

  • CREATE ALIAS


These commands perform no action when trying to edit or create files in a system folder. However no error message is displayed:
  • CREATE DOCUMENT

  • TEXT TO DOCUMENT

  • BLOB TO DOCUMENT

  • BLOB TO DOCUMENT


These kinds of problems occur when trying to create or edit files into a system folder. To fix this problem, restart the 4D application as an admin.