title: Java 'file.delete()' Is not Deleting Specified File
body: <p>This is currently what I have to delete the file but it's not working. I thought it may be permission problems or something but it wasn't. The file that I am testing with is empty and exists, so not sure why it doesn't delete it.</p>
  
  <pre><code>UserInput.prompt("Enter name of file to delete");
  String name = UserInput.readString();
  File file = new File("\\Files\\" + name + ".txt");
  file.delete();
  </code></pre>
  
  <p>Any help would be GREATLY appreciated!</p>
  
  <p>I now have:</p>
  
  <pre><code>File file = new File(catName + ".txt");
  String path = file.getCanonicalPath();
  File filePath = new File(path);
  filePath.delete();
  </code></pre>
  
  <p>To try and find the correct path at run time so that if the program is transferred to a different computer it will still find the file.</p>