Questions tagged [file-not-found]

An error, exit status, or exception that indicates that the file denoted by a specified pathname could not be found.

An error, exit status, or exception that indicates that the file denoted by a specified pathname could not be found. In other words, you're trying to access a file that doesn't exist where the code is expecting it to be.

This could occur as a result of many different actions, such as...

  1. The file doesn't actually exist, or was deleted before you could access it
  2. There is a spelling mistake in your pathname, or the pathname contains characters that aren't permitted in the pathname.
  3. You're using a relative pathname (such as file.txt) and the file doesn't exist in the default working directory for your application
  4. The code is getting confused due to different directory path indicators on different operating systems (ie / vs \)
  5. The programming language interprets the \ character in a String to be a escape character for a special symbol (such as \n indicating new-line), and you're using single \ slashes as directory indicators instead of \\ for a single escaped slash.
  6. In some languages, it could also give this exception if you aren't able to access the file due to security permissions.

Your code should be able to prevent or handle this condition, such as by doing the following...

  1. Detect - Many programming languages allow you to create a File object as a virtual representation of a physical file. Further to this, you can usually call a method or function that asks whether the file exists, such as exists();. This would allow you to check the file exists before you attempt to access it
  2. Prevent - If the user is selecting a file, present them with a FileChooser dialog rather than a text entry field. FileChooser dialogs echo the files that exist in the system, so spelling mistakes are avoided. If you're using relative paths, convert them to absolute paths if practical, or ensure you set the relative path location to a known directory before trying to access files relatively.
  3. Handle - Wrap your file access methods in exception-handling code, such as a try-catch block. This will allow you to catch unexpected exceptions, and perform an alternate operation, such as alerting the user of the error.
601 questions
0
votes
1 answer

File not found while creating process VB.NET

I'm getting this error: System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at…
FerMelon
  • 93
  • 3
  • 13
0
votes
2 answers

Master Page does not exist error in an irrelevant directory

I have a ridiculous question about master pages in asp.net. I have several pages under a project and all of their master page paths are determined like this: MasterPageFile="~/zFrame/InterfaceMaster.master" However when I run the project, I…
Dogugun Ozkaya
  • 134
  • 1
  • 8
0
votes
2 answers

The solver configuration does not exist error in grails optaplanner

I am trying to run the cloud balancing example as in optaplanner site here. I have placed the cloudBalancingSolverConfig.xml file in web-app/xmls directory. Here is my code of the save action of CloudBalanceDomainController: def save() { def…
rahulserver
  • 10,411
  • 24
  • 90
  • 164
0
votes
1 answer

AVAudioRecorder does not save file

I am struggling with the AVAudioRecorder (and Player) now. I have an application in which there are three simple buttons which do record/play/stop calls, and I'm using AVAudioRecorder and AVAudioPlayer to record and play the sound. Right now, when I…
0
votes
1 answer

The system cannot find the path specified (java eclipse)

I'm not coing to copy paste all my code, but here's the line where I get the error : try { BufferedReader in = new BufferedReader(new FileReader(args[0])); } catch(IOException e) { System.out.println(e); } In the run configuration, I've…
0
votes
1 answer

Error of file not found while running a program in Visual Studio 2010

*while running a program in Visual Studio 2010 I got an error Written "Unable to start program c:\users......... system cannot find specific file." Please tell me solution of it*
0
votes
3 answers

I am having a null pointer exception and i'm not sure where it is in my code

I am having issues with various exceptions in my code. The class is designed to find all folders/subfolders on the computer and list them as an ArrayList. It does not care about the files in them. Here is the code. please help, I have been…
0
votes
2 answers

File not found with multiple azure instances

I'm running 2 azure instances on my cloudservice that is hosting a website. I upload a file to a folder and it's saved in one of the instances. When I try to load it, if azure chooses the wrong instance, it doesn't find the file. What options do I…
simple-thomas
  • 671
  • 7
  • 20
0
votes
1 answer

Visual Studio 2012 app could not load file or assembly

The infamous Could not Load file or Assembly "filename.dll" or one of its dependencies. I get this error when a client tries to run my mixed c/c++/c# app developed in VS2012. I used Process Monitor to see exactly which modules are not being loaded…
0
votes
0 answers

script tag returns 'not found' on newly written file

I'm writing a webpage (in PHP / javascript) that is supposed to check whether jQuery.js exists at a certain location, write it to that location if it's not already there (by grabbing it from the internet), and then send the newly written jQuery to…
nttaylor
  • 788
  • 3
  • 11
  • 25
0
votes
1 answer

SenTestKit is not found Error in xcode

I just started developing an ios app and I got the error: 'SenTestKit/SenTestingKit.h' file not found and then it failed the build. I looked in the frameworks folder and it wasn't there. I am not sure if I am looking in the wrong place or if it…
Dylan Vander Berg
  • 1,809
  • 1
  • 22
  • 37
0
votes
4 answers

Android XML file parsing file not found exception

I'm new at Android and trying to get a local XML file and get data and display it . Here's my code: public String GetXmlData() { DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = null; …
albatross
  • 455
  • 2
  • 8
  • 27
0
votes
2 answers

Control file with serialization

I'm working on an Aplication and I want to have an ArrayList in a file. I wrote the two methods to save and get : public static boolean saveMetars(Context context, ArrayList metars) { try { FileOutputStream fos =…
cpfp
  • 377
  • 1
  • 4
  • 15
0
votes
1 answer

Logged error at null.aspx - what us that?

I am having a hard time reproducing an error I have seen in my logs. It says /app/null.aspx does not exist. And I can't find a way that a user can produce this problem, yet somehow they did several times after signing up. Any ideas? The trace is: …
Le-roy Staines
  • 2,037
  • 2
  • 22
  • 40
0
votes
1 answer

How to fix "file not found" errors in apache2 log

I'm building an MVC framework in PHP. I'm using segmented URLs like so: http://mydomain.com/controller/method/param1/param2 I'm using the following rewrite rules in Apache .htaccess: Options +FollowSymLinks RewriteEngine on RewriteRule…
Neil Girardi
  • 4,533
  • 1
  • 28
  • 45