0

I am working with VMware Fusion virtual machines and I need to access a file located in the following path:

/Users/administrator/Documents/Virtual\\ Machines.localized/Win7_Pro_SP1_64.vmwarevm/Win7_Pro_SP1_64.vmx

I am using the Perl command :

open IN, "<","<above mentioned path>"

but it doesnt work. If I copy the .vmx file to another location outside of the .vmwarevm, then it works. I have a feeling that since .vmwarevm is actually an application and by default opens with VMware Fusion, i.e. why perl command is not able to open it.

I cant copy it and use, so is there a way to open file from such a path. My operating system is Mac OSX

SherinThomas
  • 1,881
  • 4
  • 16
  • 20

1 Answers1

1

You can try this:

open my $in, '<', '/Users/administrator/Documents/Virtual Machines.localized/Win7_Pro_SP1_64.vmwarevm/Win7_Pro_SP1_64.vmx'
    or die;

if there is just space in Virtual Machines, no need to escape it.

bvr
  • 9,687
  • 22
  • 28
  • Thanks for this, I was actually using the above filename string to invoke the vmx to run operations, for which the '\' is required while giving commands in bash. However, as it turns out for file read when we give the path, '\' need not be provided. – SherinThomas Jul 28 '11 at 19:30
  • @SThomas - yeah, shell needs escaping, as well as with [glob](http://perldoc.perl.org/functions/glob.html) function. – bvr Jul 29 '11 at 07:10