Public Function IsExist(ByVal StrFileName As String) As Boolean On Error GoTo Xe Open StrFileName For Input As #1 Close #1 IsExist = True Xi: Exit Function Xe: 'MsgBox Err.Description, vbCritical Resume Xi End Function
Function IsExist(ByVal file As String) As Boolean Return IO.File.Exists(file) End Function
public bool IsFileExist(string filename) { return System.IO.File.Exist(filename); }
Function FileExist(filename) Dim fs, exist Set fs = Server.CreateObject("Scripting.FileSystemObject") exist = fs.FileExists(filename) Set fs = Nothing Return exist End Function 'Utilisation : If FileExist("c:\test.txt") Then '... End If
$myBool = file_exists ($fileName); // $myBool = true si le fichier $fileName existe || false s'il n'existe pas
FileExists('C:\fichier.txt'); // Renvoie un boolean
Public Declare Function GetFileAttributes Lib "kernel32.dll" Alias "GetFileAttributesA" (ByVal lpFileName As String) As Long Public Const INVALID_FILE_ATTRIBUTES As Long = &HFFFFFFFF Public Function DoesExist(ByRef vsPath As String) As Boolean DoesExist = (GetFileAttributes(vsPath) <> INVALID_FILE_ATTRIBUTES) End Function
Public Function FileExist(ByRef inFile As String) As Boolean 'Fonction provenant de EDais (edais.mvps.org) On Error Resume Next Let FileExist = CBool(FileLen(inFile) + 1) End Function
//l'import qui va bien import java.io.File; //une fonction qui regarde si un fichier existe boolean file_exists(String fichier) { File f = new File(fichier); return f.exists(); }
#premier snippet en Python ! #l'import qui va bien import os #la fonction def file_exists(fichier): try: file(fichier) return True except: return False
MonFichier est une chaîne = "\Temp\Exemple.txt" SI fFichierExiste(MonFichier) = Vrai ALORS Info("Le fichier "+ MonFichier +" existe bien") FIN
var existe=new ActiveXObject("Scripting.FileSystemObject").FileExists(filename);
<cfif FileExists(ExpandPath('myfile.txt'))> File exist <cfelse> File not found ! </cfif>
isf = lambda f:True if (os.path.isfile(f)) else False
if(-e "file.txt") { # ... }
Function FileExists(sPathFile) ' reader Dim oFSO Set oFSO = CreateObject("Scripting.fileSystemObject") ' retour FileExists = oFSO.FileExists(sPathFile) ' nettoyage Set oFSO = Nothing End Function
proc FileExist f {return [file exists $f]}