Search code examples
perlmacosvmwareosx-leopardvmware-fusion

Problem opening a file in Perl.


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


Solution

  • 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.