file-exists

Test if file exists using VBA or Excel without “DIR”

六月ゝ 毕业季﹏ 提交于 2019-12-11 05:49:55
问题 I am stepping into a directory of folders and looking into the folders to get particular data each time I find a specific file. If I go to open the file I am looking for in a folder that it is not in, I get a debug error. So clearly I need to test the directory to see if the file is there and not try to open it if it is not (that is fine, not all the folders have the subject file). The DIR function is the hands on favorite to test a file's presence, but because I am using the DIR function to

check inifile exist delphi

[亡魂溺海] 提交于 2019-12-11 04:28:07
问题 How can I check if an INIfile exists? in a specific path and under a specific name? 回答1: For instance this way ... if FileExists('c:\yourinifile.ini') then ShowMessage('c:\yourinifile.ini exists :)'); 回答2: Call FileExists passing the full path to the file. So, just the same as you would do for any file. 来源: https://stackoverflow.com/questions/5462260/check-inifile-exist-delphi

PHP file_exists() anomaly

前提是你 提交于 2019-12-11 03:03:16
问题 i ran into this wierd problem: the $myImg variable has been extracted from some local html and points to a file i would like to check. With the string variable file_exists gives false, but if the content os variable is inserted manually it gives true. var_dump($myImg); outputs: string(26) "content/images/1107_16.jpg" var_dump(file_exists($myImg)); outputs: bool(false) var_dump(file_exists("content/images/1107_16.jpg")); outputs: bool(true) How could it happen? Thanks for any help in advance

PHP file_exists not working outside document root

廉价感情. 提交于 2019-12-11 01:09:31
问题 I have the following directory structure where the Document Root is pointed to /var/www/html/public: /application /application/controllers /public (Document Root) I am trying to use the following code to check if a file exists inside a file in the /public directory (working on local setup, but not on live server) <?php if (file_exists('../application/controllers/TestController.php')) { /* do something */ } Could there be something in the Apache config file the I need to add? I am not sure

PHP file_exists and unlink doesn't work

不想你离开。 提交于 2019-12-11 00:54:12
问题 Source Code (Código): $path = "F:/www/__DADOS__/__SESSAO/__9987f2bfdfb80bce8fd72402887bb2c50a433ae0__E6nDSMnD7TCY5#47$BNCx0e#47$r#47$ByZJvcyMIazXSYWBWBXN5lgdZOd3Ps#47$ROrVSPl7QVQaCqfa2WezCauk#47$LVFyhgw==.meudominio.com.sessid" file_put_contents($path, $texto); unlink($path); In the above code I get the warning No such file or directory in unlink($ path); and the file is not deleted, I also tried using file_exists to check the file before, and the return is: false . The file_put_contents

Tcl + Check file existence

若如初见. 提交于 2019-12-10 15:33:16
问题 I'm trying to check if a file exists or not in Tcl, but I can't seem to get a true result. Even though I know it is present. while {true} { if { [file exists $file_name] == 1} { exp_send "copy file.txt destination \r" puts " File copied!" } puts "File Not copied" } I always execute the File not copied line. I did a put for [file exists $file_name] and I always end up with 0. But I know for a fact that the file exists in the current directory. Any suggestions? EDIT: An alternative method that

unlink/file_exists and file not found

北城以北 提交于 2019-12-09 17:50:50
问题 I have this code in my application, often run in race condition by severals users of my application clearstatcache(TRUE, $filepath); if(file_exists($filepath)) unlink($filepath); But, for this line of code, I still have severals errors each day like unlink(file): No such file or directory Server run Apache 2.2 and PHP 5.3.3. I know race problem, but think @ operator is just evil. I have first tried without any parameter for clearstatcache(), with the same error. How can I do it the correct

php echo if two conditions are true

こ雲淡風輕ζ 提交于 2019-12-09 16:52:04
问题 The actual code looks like this: if (file_exists($filename)) {echo $player; } else { echo 'something'; but it displays the player even if the id is not called from the url i need something like this: check if $filename exists and $id it is not empty then echo $player if else echo something else i check if $id is not empty with if(empty($id)) echo "text"; but i don't know how to combine both of them Can somebody help me? Thank you for all your code examples but i still have a problem: How i

Python, subprocess, call(), check_call and returncode to find if a command exists

拥有回忆 提交于 2019-12-09 08:30:13
问题 I've figured out how to use call() to get my python script to run a command: import subprocess mycommandline = ['lumberjack', '-sleep all night', '-work all day'] subprocess.call(mycommandline) This works but there's a problem, what if users don't have lumberjack in their command path? It would work if lumberjack was put in the same directory as the python script, but how does the script know it should look for lumberjack? I figured if there was a command-not-found error then lumberjack

How to tell if dynamically loaded image exists

六月ゝ 毕业季﹏ 提交于 2019-12-08 07:37:39
问题 I'm dynamically loading images from a different website into an asp.net ListView control like this: <ListView> <ItemTemplate> <img src='<%# string.Format("http://www.Website.com/Images/{0}", Eval("ImageName")) %>' /> Sometimes, the images don't exist and I need to change the src to a static path: src="/whatever/default.png". What is the fastest way I check if the image exists and update the src if it doesn't (any client side possibilities via jQuery)? The ListView is paged and could contain a