[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: copyfile() not working on my new Win7 PC
From: |
Tim Rueth |
Subject: |
RE: copyfile() not working on my new Win7 PC |
Date: |
Tue, 28 Sep 2010 07:26:26 -0700 |
> -----Original Message-----
> From: Tatsuro MATSUOKA [mailto:address@hidden
> Sent: Tuesday, September 28, 2010 12:56 AM
> To: address@hidden; address@hidden
> Subject: Re: copyfile() not working on my new Win7 PC
>
> Hello
>
> I am still using windows XP so that I cannot help you.
>
>
> > C:\Octave\3.2.3_gcc-4.4.0\MSYS\bin\cp.exe: ***Couldn't
> reserve space
> > for cygwin's heap, Win32 error 0
> >
> Strange!! octave-3.2.3 for windows (MinGW) uses Msys and
> there is no relation to the cygwin.
> Your Win 7 seems to misunderstand cp.exe on msys as that on
> the cygwin.
>
> execute sh shell by
> octave > system('sh')
>
> Try cp command on the msys sh shell and see the response.
>
> Regards
>
> Tatsuro
>
> --- Tim Rueth wrote:
>
> > I recently got a new Windows 7 PC and installed Octave
> 3.2.3 on it. I
> > ran one of my tried-and-true scripts on it, and I get an
> odd message
> > when it tries to execute a copyfile() instruction near the
> end of the
> > script. Here are relevant parts of the code:
> >
> > tempfile = ["temp.txt"];
> > fid = fopen(tempfile, "wt");
> > ...
> > foo = 10;
> > <write some stuff to the file>
> > ...
> > fclose(fid);
> > resfilename = ["thisrun" num2str(foo,"%2d") ".txt"];
> > copyfile(tempfile,resfilename);
> >
> > When I run this script on my Vista machine, it runs fine.
> But when I
> > run it on my Win7 machine, this is what I get right after
> the copyfile
> > command is
> > executed:
> >
> > 0 [main] us 0 init_cheap: VirtualAlloc pointer is
> null, Win32
> > error
> > 487
> > AllocationBase 0x0, BaseAddress 0x71110000, RegionSize
> 0x290000, State
> > 0x10000
> > C:\Octave\3.2.3_gcc-4.4.0\MSYS\bin\cp.exe: ***Couldn't
> reserve space
> > for cygwin's heap, Win32 error 0
> >
> > So, it looks like it couldn't copy the file because it couldn't
> > reserve space for cygwin's heap. Not sure what that means
> or what I
> > can do to fix it. Note, tempfile is not a large file. Any
> help would
> > be greatly appreciated.
> >
> > Thanks,
> >
> > --Tim
Okay, I typed "system('sh')" at the Octave prompt, and I got a very similar
response (even before getting a chance to do the cp):
0 [main] us 0 init_cheap: VirtualAlloc pointer is null, Win32 error
487
AllocationBase 0x0, BaseAddress 0x71110000, RegionSize 0x290000, State
0x10000
C:\Octave\3.2.3_gcc-4.4.0\MSYS\bin\sh.exe: *** Couldn't reserve space for
cygwin's heap, Win32 error 0
As you can see, this is almost identical to the error I got when trying to
do the copyfile() command, except ...cp.exe is replaced with ...sh.exe. So,
it looks like the OS has trouble executing shell commands through Octave?
If I just call up a Commmand Prompt window and do a copy, it works fine.
Also, the following works too:
Octave> dos(["copy" " file1.txt " "file2.txt"]);
So I can't figure out why I'm getting the errors when doing copyfile() and
even just doing system('sh'). Thanks for any help!
--Tim