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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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

 



wajdi
New User

Aug 3, 2016, 9:21 AM

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

Hello,
I have following script which is execute in Cygwin:

Code
(...)    
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)


FishMonger
Veteran / Moderator

Aug 3, 2016, 12:06 PM

Post #2 of 2 (2831 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.

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

or

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

or

Code
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