May 22, 2003 #1 cartw19 Programmer Feb 11, 2003 8 GB How do I obtain a disk volume label in a Perl program running under Windows 32. e.g. I have a CD Rom in my drive d:, how do I find the volume label of the CD Rom? Any sugestions welcome, Colin
How do I obtain a disk volume label in a Perl program running under Windows 32. e.g. I have a CD Rom in my drive d:, how do I find the volume label of the CD Rom? Any sugestions welcome, Colin
May 22, 2003 1 #2 tonykent IS-IT--Management Jun 13, 2002 251 GB One method would be to use the system's 'vol' command. On my NT box typing vol d: produces the following output: Volume in drive E is perl2 Volume Serial Number is 1C70-9ECA You could output that to a text file and then use a regex to grab the volume name. Upvote 0 Downvote
One method would be to use the system's 'vol' command. On my NT box typing vol d: produces the following output: Volume in drive E is perl2 Volume Serial Number is 1C70-9ECA You could output that to a text file and then use a regex to grab the volume name.
May 22, 2003 #3 tonykent IS-IT--Management Jun 13, 2002 251 GB This works for me: @myarray = `vol e:`; @myarray[0]=~m/\s(\w+)$/; print "volume is $1\n"; Upvote 0 Downvote
May 22, 2003 #4 PaulTEG Technical User Sep 26, 2002 4,469 IE For more comprehensive coverage look at Win32:riveInfo, Paul Upvote 0 Downvote
May 23, 2003 #5 tonykent IS-IT--Management Jun 13, 2002 251 GB Thanks for bringing Win32:riveInfo to my attention Paul. It works a treat. Upvote 0 Downvote