Skip to main content

Questions tagged [file-exists]

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

file-exists
Filter by
Sorted by
Tagged with
0 votes
1 answer
53 views

Python - os.path.exists for jpg

I tried to read jpg pictures, but the path was always not found even though the path was correct. So I checked with os.path.exists. The image is called "ralf". And for os.path.exists("C:...
Jeje Hombold's user avatar
2 votes
1 answer
639 views

A better way of create a file if it doesn't exist using Ansible?

I'd like to create an ansible task. The playbook itself should install and configure some settings in my new linux environment, so, one of the thinks I need to do is to install zsh, and after that, ...
FueraDeServicio's user avatar
1 vote
0 answers
28 views

Python script won't skip past files that match naming convention set in file renaming program

I have a python program that renames tv show files to match a preferred naming convention I prefer but it only works on episodes that don't match the convention. When it gets to the first of matching ...
MindCrasher11's user avatar
0 votes
1 answer
69 views

PHP file_exists, filemtime, stack, not work, but file exits,

I need to read some paths from a csv file and show it in the browser. I can read the file with file_get_contents. But the encoding from the csv file is wrong. So i need to use mb_convert_encoding($...
bia's user avatar
  • 25
3 votes
1 answer
116 views

Test-Path -Path behaviour with array of paths

I'm trying to check if multiple files/folders exist. The Test-Path parameter -Path accepts a [string[]] array. Please see example code: $arr = @( "C:\a\fake\path\test1.txt", "C:\...
Jelphy's user avatar
  • 1,025
0 votes
1 answer
1k views

How to Check Image Exists in Public Folder of Next JS

I have a TypeScript Next.js project that has thousands of images in the public folder. Is there any way I can check an existing image before using the <Image /> component in next/image? I was ...
InSho's user avatar
  • 11
1 vote
0 answers
50 views

"If exist" pattern to match files, but not directories

I have a Windows batch script which uses if exist, (I replaced long pathnames with SomePath): if exist "D:\SomePath\Blah\Inbox\*.*" CALL :SUB_MoveFiles Blah The Inbox directory, in this ...
RichSilv's user avatar
0 votes
2 answers
601 views

How to Access Files in ASP.NET Web Forms Application via Virtual Directory on Network Location?

Processing files in a virtual directory under IIS is successful when the client is on the server but fails when the client is on another PC on the network. We have an ASP.NET Web Forms application (c#)...
Ray Megal's user avatar
2 votes
0 answers
284 views

File.exists() always returns false when using Map Network Drive for a shared folder

On my Windows Server (2012 R2), I added a shared folder from another server to a Mapped Network Drive (X:) as in the image below. Then, I have this snipper code to get files from a specified ...
NoName's user avatar
  • 966
0 votes
1 answer
75 views

I am running batch file but if exist always returns True , Why is it happening?

I have this code, this always returns True and file get moved. What is the problem with my code ? I am running on Windows batch file. @echo off title echo setlocal ...
abhishek kalwit's user avatar
0 votes
1 answer
56 views

How to increase the speed of checking files for existence for network resources&

I have tried various options. At first it was File.Exists(). But it runs for 2 seconds on each element. And I have, for example, 60 elements. It takes 2 minutes. Then I tried getting a list of paths ...
Viktor Bylbas's user avatar
-2 votes
1 answer
270 views

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:\\...
Peter Penzov's user avatar
  • 1,028
0 votes
2 answers
2k views

How to read file through jenkins from github

I am trying to read a file from github using readFile, sshagent (credentials: ["${github_cred}"]) { script { ...
Alfred's user avatar
  • 15
0 votes
0 answers
80 views

file_exists can't find filename including ampersand on Linux

I have two files: one called AB.txt, the other called A&B.txt. For each, I run the following PHP code: echo "[$arq]"; if (file_exists($arq)) { echo '[found]'; } else { echo '[...
Rodrigo's user avatar
  • 4,970
1 vote
1 answer
91 views

How to check for any files with FileExists(String) method

I'm trying to automate a document handling process, and I need to check if there are any files inside a certain folder. The process itself removes the files from the folder once it finishes, so I need ...
Giancarlo Caorsi's user avatar
0 votes
1 answer
31 views

php readfile wont read filename with inverted questionmark

I have an example filename: $filename = "./music/Daddy Yankee - ¿Qué Tengo Que Hacer.mp3" When attempting to run if (file_exists($filePathAudio)) { } returns file not found Have confirmed ...
MBF's user avatar
  • 346
0 votes
1 answer
210 views

Check if file from list exist or have the same basename

I'm looking to optimize this script with a function $Folder = 'K:\dxf\dxf50000-60000' $filenames = Get-Content -Path .\files.txt $missingFilesList = New-object System.Collections.ArrayList Write-...
Lucas's user avatar
  • 7
0 votes
1 answer
607 views

VBA FileExists and Sharepoint

I'm running into issues trying to pull info from files stored in Sharepoint. Namely, FileExists isn't working and Overwrite file doesn't seem to be working either. There was a discussion here, but few ...
Mike's user avatar
  • 133
0 votes
2 answers
132 views

php file_exists() only works once in the same function

I have a php function that renames two separate image files from a temporary to permanent path after first confirming that the temporary path exists. When it checks for the fist file it works fine but,...
Catie Camastro's user avatar
0 votes
1 answer
205 views

What is the PHP manual talking about with clearstatcache()?

You should also note that PHP doesn't cache information about non-existent files. So, if you call file_exists() on a file that doesn't exist, it will return false until you create the file. If you ...
Homer's user avatar
  • 131
1 vote
1 answer
773 views

Java 17 path exists() taking an extraordinarily long time when file exists

I'm using Java 17 on Windows 10. I have a set of directories in this form: data/dir-0 data/dir-1 data/dir-2 … data/dir-999 I have a loop over the integers 0 to 999 with variable i. Within each loop, ...
Garret Wilson's user avatar
0 votes
1 answer
2k views

std::filesystem::is_regular_file() vs ::exists()- what counts as a regular file

I am using Visual Studio 2017 C++ WITH MFC I have a program in MFC that collects filepaths as strings and adds them to a zip file. I want to add an error check, where I check if a file exists before ...
Husam Chekfa's user avatar
1 vote
0 answers
265 views

How to make sure that the given file to multer exists in Node.JS

First of all I'm working with Node.JS with Express I made a code that allows me to upload an image with multer to a specific directory, and here is a simplified version of it: const storage = multer....
arrmani88's user avatar
  • 983
2 votes
0 answers
483 views

How to wait for a file to exist in Nodejs

In my Node.js application, I need to read from a log file which has this two condition: It may not created yet. It is going to be created in some seconds. It is updating and log lines are added to it ...
mshadi's user avatar
  • 219
-1 votes
1 answer
51 views

How can I make a webpage that checks my server for a folder and counts the number of folders under that

I want to use a html webpage to look on it's source server to a specific subfolder (/home/pi/Pictures) and then count the number of subfolders there and print that out on the page when viewed remotely ...
QWKSILVER's user avatar
0 votes
1 answer
147 views

PHP file_exists not working (multiple execution in same browser)

I'm trying to understand why this script doesn't work, when I execute script simultaneously in same browser or browser tab, second script do not see the created file "/tmp/monkey.tmp" (php7....
Peter's user avatar
  • 33
-2 votes
1 answer
853 views

Powershell - Delete a file based on the existence of another file

I'm trying to create a Powershell script that will delete specific files only when another file exists in the same folder as the file to be deleted. All my attempts up to now have proven fruitless. ...
Tim H.'s user avatar
  • 19
0 votes
1 answer
90 views

How to check if file exist Ms Access

"I have a table "File Link" in ms access having two fields. I want to set the "Status" True or False if the file exist in "LINK". Can any body help me?" Link ...
Farrakh Hayat's user avatar
0 votes
0 answers
44 views

Want use 'or' operator whit file_exists php

I want to use or operator in php file_exists() function. I have files whichone name admin_blablabla.php and i also have files withoutadmin 'tag'. I don't use any php framework etc. Does any idea why ...
AlexSwamp's user avatar
1 vote
1 answer
2k views

.exist() - file does not exist, when using relative path [duplicate]

Edit: If you have landed on this question, chances are you are unfamiliar with the concept - working directory. I don't know if this is specific to IntelliJ IDEA's current working directory or I do ...
user avatar
0 votes
0 answers
51 views

How can i check exist of a file base on the user input [duplicate]

Thanks for all answers, now i have a new question: why whatever i input the output is always GREAT? Like if the input is not pokemon.csv, then it should returns me "pokemon.csv file is not found. ...
朱旭翔's user avatar
0 votes
0 answers
54 views

Eclipse IFile: Create not called when jar is deleted

I have a method that checks if a file exists then it deletes the file but will always create a new file (Jar file). I am using the org.eclipse.core.resources.IFile class for create and delete methods. ...
ice's user avatar
  • 141
0 votes
0 answers
676 views

PHP Add Column Data to Table IF Condition True

This is a tough one. I'm not sure how to explain this but I'll try my best. I have a table where all values are coming from DB based on a search form: The last column "Map Link" appears if ...
Tiffany's user avatar
  • 13
-3 votes
1 answer
594 views

How to set correct syntax if (fso.FileExists("")) after checking with fso.GetAbsolutePathName(".") [duplicate]

I'm struggling with correct syntax for setting the path in: if (fso.FileExists("myfile.txt")) then .... I use this: set fso = WScript.CreateObject("Scripting.FileSystemObject") ...
DoomneT's user avatar
1 vote
0 answers
237 views

VBScript does not oFS.FileExists a file in oFS.CreateFolder

I'm having a strange problem with VBScript. I'd like to implement some other code with a following test: If there is a file named like [that] in the [folder], do not copy it into the [folder]. Thing ...
Mateusz's user avatar
  • 23
0 votes
1 answer
397 views

PHP validate file_exists in .m3u file

I have a .m3u file, and I'm trying to validate each line to validate file_exists on the path. Here's a single line: /home/scott/Music/Whitesnake/Whitesnake (30th anniversary edition)/1-01 Still of the ...
Scott Fleming's user avatar
0 votes
1 answer
499 views

Want to check IF File.Exists to define StreamReader, to then searching for specific line

I don't write code often and my knowledge is still low-level. I need help for something that I can't figure out public static void SearchScriptEnd() { int counter = 0; string ...
Pascal D.'s user avatar
2 votes
1 answer
377 views

Node.js: check if ANY kind of filesystem entry exists, INCLUDING: broken symlinks (can't use fs.existsSync)

I'm trying to write a simple function in Node.js to check if a filesystem entry exists, it could be any kind of entry, including: A regular file - return TRUE A directory - return TRUE A valid ...
LaVache's user avatar
  • 2,579
0 votes
0 answers
1k views

Script task to check if file exists then email

I've got a simple SSIS package that I want to include a section that determines if the file existed in the folder or not and email out either a fail or pass email. I've tried to use a script task ...
Andrew's user avatar
  • 31
1 vote
1 answer
1k views

fileExists in jenkins pipeline not working with ${variant}

In jenkins pipeline variant is read from job config as variant = job_config['variant'] variant can be either 'abc' or 'xyz' depending on what is entered in job config. if(fileExists('tmp/build/${...
Vasudev gowda's user avatar
-1 votes
1 answer
57 views

App cannot find path on a Mac (works on Win under similar conditions)

I developed an app for localhost use on a Windows computer (previously with MAMP, not using XAMPP all around). Same app on a Mac where it is intended to be used cannot find the log files I need to ...
Valle's user avatar
  • 1
0 votes
0 answers
462 views

Android: no such file or directory error reading xml file [duplicate]

I'm updating an old Android app that took an xml file, parsed it and stored data into a databse. The error i get is 'no such file or directory'. The basic fixes i tried are: -Place the file in the ...
user1206709's user avatar
0 votes
0 answers
419 views

Unlink Image from Directory

i am getting error called 'No such file or directory in' while unlinking the file here is my code :- $data= $_SERVER['DOCUMENT_ROOT'].'/root_dir/sub_dir/'.$_POST['media']; if(unlink($data))){ ...
Sabir Hala's user avatar
0 votes
1 answer
2k views

Os.walk() loop to check if file exist or not

I got stuck at looping through folders with os.walk. My code looks like this: import os from datetime import timedelta startD = date(2020,7,10) day= timedelta(days=1) EndD = date(2020,7,13) folder = ...
MachuPichu92's user avatar
0 votes
0 answers
203 views

how to check if an image exists or not in a flutter?

I'm working an image.netwrok in a flutter. getting the image name from the database if the name exists in the database but the image is missing in the directory then it throwing error. my issue is ...
Arshad Sherani's user avatar
0 votes
1 answer
214 views

Bash script not recognizing existing file

I have to write a simple bash script, which does the compilation of multiple sql scripts which can contain recursive references to the other sql scripts with Oracle SQLPlus convention, so in the end ...
Artur Linhart's user avatar
-2 votes
1 answer
649 views

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 ...
Mindaugas Jonikas's user avatar
0 votes
1 answer
1k views

Check if file exist inside custom folder in Downloads - getExternalStoragePublicDirectory deprecated

What I'm trying to achieve is to check before download if the file exists so i don't have to re-download it again. For example, i have to open for the first time this pdf from the Internet "...
Astrit Veliu's user avatar
  • 1,502
0 votes
1 answer
318 views

powershell check for existence of multiple inputs

I need to check if files from input exists. I split multiple inputs for example BWMDL.VML BWMDL.STA etc and write out files that are already in folder I check if files from input are present in ...
Filip's user avatar
  • 11
0 votes
1 answer
205 views

File Exists() method finds file that does not exist in Eclipse Java Package

Please see my code below. I'm working in Eclipse. The project I'm working on definitely does not have an attached file called "log.txt". But when I run the code below, the value "...
FinDev's user avatar
  • 429

1
2 3 4 5
13