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
-1
votes
1 answer

Make a new filename if old file exists

I am trying to check if file exsist. If it does just want to increment the new filename. So this is how I have done: File gpxfile = new File(root, "Avvikelserapport" + dateofday.getText().toString() + customer.getText().toString() + ".pdf"); int…
-1
votes
2 answers

file_exists doesn't find image with Cyrillic name

I have this image "Трислоен-паркет.png" and this to check if it exists: $imgs='../images/pc/'.clear_string($categoryrow[1],$tr).'.png'; if(file_exists($imgs)){ echo 'yes'; }else echo 'no'; It always returns NO. The strange thing is that…
thecore7
  • 484
  • 2
  • 8
  • 29
-1
votes
2 answers

check and read file from subdomain

i have subdomain sub.domain.com. the subdomain points on a directory root/sub of my root dir on my Webserver. now i have pdfs on another dir on the server root/pdf. How can i check if a specific pdf exists and if it exists i want to copy the file to…
user1121575
  • 390
  • 1
  • 4
  • 19
-1
votes
2 answers

PHP - Check if file exists without knowing the extension

I already saw this question, but it didn't work for me. What I need to do is to check whether a file exists, in PHP, without knowing the extension. I use this code:
Isaiah
  • 1,852
  • 4
  • 23
  • 48
-1
votes
2 answers

NSURL with string giving null value

Below is what I have NSString *foofile = @"/Users/alkandari/Library/Application Support/iPhone Simulator/6.1/Applications/8C445026-6387-4E40-B5A3-D1A1680666D6/Documents/ProjacsBODFiles/file_5_21.pdf" NSURL *url; if (fileExists) { url = [NSURL…
Fahim Parkar
  • 30,974
  • 45
  • 160
  • 276
-1
votes
1 answer

How to find files whose paths do not exist in the text file using powershell

I need to check and return files that exist in the filesystem, but are not listed in a given text file. For instance, my text file (sample.txt) will contain paths…
ashish g
  • 281
  • 3
  • 7
  • 14
-1
votes
2 answers

PHP if file_exists() statement fails on file_get_content() from URL

I have a very simple function to read URL image file and save it on server. function o99_download_shot_binary(){ $url = esc_url_raw( o99_get_content_link() ); // function returns http:// url $img = $uploads['basedir'] . '/tmp/' .…
Obmerk Kronen
  • 15,619
  • 16
  • 66
  • 105
-1
votes
1 answer

access data from network / with php

if i try to access data from my computer it works $test = "\\\\Pcname\folder\blabla.txt"; or $test = "D:\\folder\blabla.txt; if (!file_exists($test)) { die("Could not find file."); } but i want to access data from local network(shared folder)…
dpz
  • 79
  • 8
-1
votes
5 answers

running a php page via crontab and having issues with if file_exists

I have a question...I am running a php page daily through a crobtab and I seem to be getting erros when this code is run.. include(CLASS_PATH .'EmailAddressValidator.php'); so I applied this…
user979331
  • 11,039
  • 73
  • 223
  • 418
-1
votes
2 answers

Parse error: syntax error, unexpected T_VARIABLE" for file_exists call

I'm using the following code to determine if a file is present in the directory pdf_Order_pdf/ which will display a working link or just and anchor link if file not present, I am a complete novice with php (as you can see) but do have a very…
wiggy1977
  • 33
  • 8
-2
votes
1 answer

Cannot move file because NoSuchFileException

I use this code to list files into directory and move it based on a found value. @Override public void execute(JobExecutionContext context) { File directoryPath = new File("C:\\csv\\nov"); // Create a new subfolder called…
Peter Penzov
  • 1,126
  • 134
  • 430
  • 808
-2
votes
1 answer

Check if file exist if true then open SFTP

First time using this website, i have a challenge now with one of our clients that they are blocking our SFTP account if we connect and do not send any file. Something that i am looking for is a script for powershell or could be anything that i can…
-2
votes
1 answer

why file_exists always return false when put value as param?

I have a function like this : public function asset_exists($path) { $webRoot = realpath($this->kernel->getRootDir() . '/../web/'); $toCheck = $webRoot . $path; if…
-2
votes
1 answer

Check if file exist in C. If so continue read the last value of the file and increment by one

Even if I delete the " file.txt " the program still enters the if statement. What I want to achieve is to check if there is a file with that name. If so then read the last value of BookId and increment it by one with for loop: FILE *myFile; if…
Klayd Pro
  • 1
  • 1
  • 2
  • 7
-2
votes
4 answers

PHP file_exists does not work. It seems to be reversing true and false

While working on my photo gallery I decided it was best to have an alternate file if image that should display doesn't. I've looked on this site, and may others. They all say to use: $VariableName = "photography/small/2014-09-21-red-1.png"; if…
Matthew Campbell
  • 1,118
  • 14
  • 25
1 2 3
40
41