CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: General Discussions: General Questions:
reload the list of disks at RunTime


New User

Aug 3, 2016, 9:21 AM

Post #1 of 2 (5461 views)
reload the list of disks at RunTime Can't Post

I have following script which is execute in Cygwin:

system ("create_mount_G_disk.bat");
# G:\ mounted
if (-d "G:") die "G: not found";

it basically calls a batch file that creates a VHD disk G:\ and mounts it.
Then if I check whether it exists, script signals always an error. Then I have to restart the script in order to pass the check

As I understood, Perl caches the list of disks at startup. So the question is whether we can force Perl to reload this list ?
is there any hint for this ?
Thanks :)

(This post was edited by wajdi on Aug 3, 2016, 9:57 AM)

Veteran / Moderator

Aug 3, 2016, 12:06 PM

Post #2 of 2 (5456 views)
Re: [wajdi] reload the list of disks at RunTime [In reply to] Can't Post

Your code won't compile due to the missing { } braces. When posting code, you should always copy/paste your actual code instead of retyping it.

Based on that code snippet, it appears that you need to reverse the logic of the conditional.

if (! -d "G:") { die "G: not found";  }


unless (-d "G:") { die "G: not found"; }


die "G: not found" unless -d "G:";

(This post was edited by FishMonger on Aug 3, 2016, 12:08 PM)


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives