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
-2
votes
3 answers

Can I access file name and file type by using File.Exists

filepath variable is coming over UDP socket. And after my codes are below: string filename=null; string filetype=null; if (File.Exists(filepath)){ filename=?????; filetype=????; } Can I access file name and file type?
Hasan D.
  • 7
  • 4
-2
votes
3 answers

PHP file_exists

This should be simple but it doesn't work $photo = "../members/".$vid.".jpg"; if (file_exists ($photo)) echo ""; In this case the image is never shown. However, if I leave out the if statement... …
delpi767
  • 37
  • 6
-3
votes
1 answer

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

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") Mypath = fso.GetAbsolutePathName(".") if (fso.FileExists("myfile.txt"))…
DoomneT
  • 1
  • 3
-3
votes
1 answer

c# check->create->check folder loop

I want ask an easy question about my code in c# .... I know that there are lot of topics with same or similar topic/code result. But I need to hand in my code to school, so I can't just use the best solution on Stackoverflow or another page. I…
-4
votes
2 answers

Check if a file exist in directory or subdirectory

I want to check if a file exists in a directory or a sub-directory. string[] filePaths = Directory.GetFiles(padserver, "*", SearchOption.AllDirectories); try { DataContainer.bestaatal = false; lusfilebestaat = 0; while…
Joeri
  • 1
  • 1
  • 4
-5
votes
1 answer

File.Exists is working in C#, but doesn't work in VB.NET

I faced with a strange problem. VB.NET - not working Dim stringData As String = Encoding.UTF8.GetString(buffer, 0, buffer.Length) If Not [String].IsNullOrEmpty(stringData) AndAlso System.IO.File.Exists(stringData) Then …
Alexander
  • 691
  • 1
  • 11
  • 29
1 2 3
40
41