SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    May 2002
    Location
    Detroit, MI, USA
    Posts
    43
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Folder Existence

    Hello group,
    Does Robot have any function that checks the existence of a folder in a specified directory?

    Justlike a 'filevp' that checks the existence of a file in a specified directory path.

  2. #2
    Senior Member
    Join Date
    Sep 2001
    Location
    Hyderabad, India
    Posts
    478
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Folder Existence

    Hi,

    Just try the following code to check the existance of a folder:

    On Error Resume Next
    MkDir "C:\TEMP"
    If Err=75 then
    MsgBox "Directory already exists."
    Else
    MsgBox "Directory created."
    End If

    In above code, existance of Temp folder is checked under C:\.
    Manoj Jain
    (manojjain99@yahoo.com)
    A highly advanced bug is indistinguishable from a feature.

  3. #3
    Senior Member
    Join Date
    Mar 2003
    Location
    Austin, TX, USA
    Posts
    1,489
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Folder Existence

    Or ...

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">tempfile=Dir(&quot;c:\golden_lots&quot ;, 16)
    If tempFile = &quot;&quot; then
    SQAConsoleWrite(&quot;c:\golden_lots directory does not exist&quot
    End If</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">

  4. #4
    Senior Member
    Join Date
    Sep 2001
    Location
    Hyderabad, India
    Posts
    478
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Folder Existence

    Hi Bryan,

    Your code will work in normal conditions. But just consider following case:

    If a folder contains a file with name "Test" (it is having no extension) and you are also looking for a folder with name "Test" then as per your code, "Test" folder exists but it is actually a file.

    Need your inputs.
    Manoj Jain
    (manojjain99@yahoo.com)
    A highly advanced bug is indistinguishable from a feature.

 

 

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 10.34%
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:57 PM.

Copyright BetaSoft Inc.