Questions tagged [file-exists]

A "FileExists" method provides a mechanism to determine if a specified path/file exists.

Overview

FileExist methods, which are available in most languages, typically have a path/filename parameter and return a Boolean value, indicating whether the file exists.

Implementations

The following links provide reference to the method descriptions for various languages:

606 questions
3
votes
3 answers

Why is this code so quick?

EDIT: This has been because of bug in my code (probably), after debugging and adding checking for correct response in my tests, test prove NO difference (what irks me a little), more in my own answer below. /EDIT Hello, I've written myself a little…
Adam Kiss
  • 11,811
  • 9
  • 48
  • 81
3
votes
3 answers

php weird file_exists bug

Has anyone got any idea to why doesn't the following work ? $file = 'images/thumbs/1%20-%20Copy.jpg'; if(!file_exists($file)){ die('NOT THERE'); } echo 'Yes its there.'; The problem is with the spaces. I have checked the file exists,dbl checked…
Val
  • 17,336
  • 23
  • 95
  • 144
3
votes
3 answers

How to check if file exist when downloading from FTP

I'm downloading from FTP server and I don't know exactly how to check if file already exist. What I want to do is that I retrieve filname from FTP server and then compare it with all files in folder. If file already exists then it compares next FTP…
Igor
  • 253
  • 3
  • 5
  • 14
3
votes
1 answer

Check for potential CSV file issue in D3

I have a D3 project that uses a very large CSV file to read the data. It works fine except sometimes user sees the spinning loading image indefinitely because of one the following issues. I need to be able to catch these issues and display some…
NoBullMan
  • 2,032
  • 5
  • 40
  • 93
3
votes
1 answer

Error in Makefile during a simple check for existing file

within a makefile I need to check if a file exists. Regarding to this answer from holms, I tried it in this way: all: ifeq ("","$(wildcard testFile)") echo "File exists" else echo "File is missing" endif Nevertheless I get…
eDeviser
  • 1,605
  • 2
  • 17
  • 44
3
votes
1 answer

Ruby keeps telling me my file does not exist

I'm trying to check if a file exists with RoR but it keeps saying this file does not exist and I can't understand why. if File.exist?('~/Desktop/test.xls') p 'File EXISTS' else p 'Cannot find any file' end Of course the file exists and I can…
El-Cortez
  • 113
  • 1
  • 11
3
votes
1 answer

How can I check if a set of files exists in an Ant build?

I'm wondering if there's a way to, using Ant, check if several files are available on disk. Currently, I have a task that looks like this:
dnh
  • 76
  • 5
3
votes
2 answers

Get image JPG and jpg

I've been bothered by this problem for a while now. I'm trying to load images in PHP but there are jpg and JPG images and when I try to load images by jpg the JPG ones are not found (obviously) $img1 = '
user6223574
3
votes
4 answers

How to detect if a file exist in a project folder?

I am having a collection of images in my project folder. how to detect if a image exist in my project folder? I am using c#. Thanks.
VHanded
  • 2,079
  • 4
  • 30
  • 55
3
votes
0 answers

Java SmbFile check if Samba directory exists() takes long

I have a piece of code which writes a file in Java to a shared Samba folder on a virtual server, but I have a performance issue/question. The first thing my code does, is checking if the Samba folder exists. If it does, it instantiates the file it…
Lewis
  • 225
  • 1
  • 6
  • 18
3
votes
2 answers

How to check uploaded file is exists with SFTP using phpseclib

I am using phpseclib to upload a file to a remote server. Previously, my script worked fine, but what I am expect is it can check whether the remote server has received the file or not. Such as if file existed return 1/true or if file no existed…
Rocky ZZ
  • 45
  • 1
  • 7
3
votes
1 answer

PHP file_exists returns false with existing files

I'm having a little problem with my PHP-code. I want to create a site which has different directories. Every directories has a file named pass (not .txt or something) with the value of the directories password. So if the pass-file doesn't exist the…
3
votes
1 answer

How to make php file_exists work with Greek characters

if the path contains a Greek character the file_exists will always return false, otherwise it works as it should. (I display Greek characters all over my page with out any problem) if( file_exists($path) ) return true; else …
3
votes
2 answers

PHP - file_exists doesn't work even if file exists in directory

Im trying to verify if file exists in directory. When I use this code it works - image is displayed: id.'-'.$imgId; echo ""; ?> When I use…
Tomas Turan
  • 1,195
  • 3
  • 17
  • 27
3
votes
1 answer

fileExistsAtPath: Does Not Return Correct Value in iOS 8 SDK

My app was working perfectly in iOS 7, and now I'm facing some new bugs after switching to iOS 8 SDK. For Ex. [NSFileManager defaultManager] file existence checking method ( fileExistsAtPath: ) is no longer working. Here's the details about current…
Sepehrom
  • 1,335
  • 2
  • 16
  • 33