SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 2 of 2
  1. #1
    Member
    Join Date
    Jul 2005
    Location
    mumbai
    Posts
    55
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Checking existance of a file and folder on disk

    I wanted to know following
    1) Existance of folder on disk
    2) If folder exists, whether its empty or not
    3) If not empty, specific file exists in it or not

    Can anybody suggest the solution ?

  2. #2
    Senior Member
    Join Date
    May 2005
    Location
    Chennai
    Posts
    687
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Checking existance of a file and folder on disk

    Hi,

    Try first FolderExistsMethod, then FileExistsMethod.

    Function ReportFolderStatus(fldr)
    Dim fso, msg
    Set fso = CreateObject("Scripting.FileSystemObject")
    If (fso.FolderExists(fldr)) Then
    msg = fldr & " exists."
    Else
    msg = fldr & " doesn't exist."
    End If
    ReportFolderStatus = msg
    End Function

    Function ReportFileStatus(filespec)
    Dim fso, msg
    Set fso = CreateObject("Scripting.FileSystemObject")
    If (fso.FileExists(filespec)) Then
    msg = filespec & " exists."
    Else
    msg = filespec & " doesn't exist."
    End If
    ReportFileStatus = msg
    End Function
    With Best Regards
    Yuva

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.11%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 01:44 PM.

Copyright BetaSoft Inc.