Répertoire est vide

Répertoire est vide

Messagepar Michael DELIQUE » 31 Oct 2013 à 11:46

Code : Tout sélectionner
Public Function DirectoryIsEmpty(Byval wPath As String) As Boolean

   Dim PathFile As String
   
   On Error Goto CatchError
   
   If Trim(wPath) = "" Then
      DirectoryIsEmpty = True
      Exit Function
   End If
   
   If Right(Trim(wPath),1)="\" Then
      PathFile = wPath
   Else
      PathFile = wPath+"\"
   End If
   
   If DirectoryIsValide(PathFile) = False Then
      DirectoryIsEmpty = True
      PathFile = ""
      Exit Function
   End If
   
   PathFile = PathFile+"*.*"
   
   If Trim(Dir$(PathFile)) = "" Then
      DirectoryIsEmpty = True
   Else
      DirectoryIsEmpty = False
   End If
   
   PathFile = ""
   
   Exit Function
CatchError:
   MsgBox "("+Cstr(GetThreadInfo (1))+" Call by "+Cstr(GetThreadInfo(10))+")"+Chr(10)+"Error " + CStr(Err) + " : "+Chr(10) + CStr(Error)+". "+Chr(10)+"Line # "+Cstr(Erl),16," ERROR !"
   DirectoryIsEmpty = False
   Exit Function
End Function
Cordialement

Michael (SMS-Phobique)
----------------------------
"La théorie, c'est quand on sait tout et que rien ne fonctionne. La pratique, c'est quand tout fonctionne et que personne ne sait pourquoi."
Albert EINSTEIN
Avatar de l’utilisateur
Michael DELIQUE
Administrateur
Administrateur
 
Message(s) : 12183
Inscrit(e) le : 16 Déc 2004 à 10:36
Localisation : Paris/Cergy

Retour vers Gestion de fichiers