Question: why march('extractfile',...) shows the .m file content as binary looking?

I am trying to look at source code of one Maple application to learn it. The application is old and uses  .lib and .ind files and not the new .mla files to store the code.

When I use the command march('list',path_to_lib), it shows the .m files there OK.

Next, when I use the command march('extractfile',path_to_lib,member_name.m,file_name_to_extract_to.m)

And then look at file_name_to_extract_to.m created in text editor, it is a binary and not plain text.

But when I do print(member_name),  in the worksheet, Maple prints the source code on the screen OK.

Below is worksheet to show this. All what you need to run this is download the zip file to your C:/TMP/ folder (or any other folder of your choice). 

https://www.maplesoft.com/applications/download.aspx?id=123874/an_extension_of_prelle-singer_method_and_maple_implementatio.zip

When you unzip the above file, you will see maple.lib, maple.ind, and maple.hdb files.  

I changed the names to PS.lib, PS.ind and PS.hdb (not to conflict with any maple own files).

So my C:/TMP/ folder now have these 3 files PS.lib, PS.ind and PS.hdb in it. 

Then I opened worksheet and did the following

restart;

libname := "C:/TMP",libname;

"C:/TMP", "C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib", "C:\Program Files\Maple 2024\lib"

march('list',"C:/TMP/PS.lib");

[["PSsolve.m", [2001, 11, 22, 12, 23, 49], 15008, 59], ["PSIntFac.m", [2001, 11, 22, 12, 23, 50], 15067, 517], ["polygen.m", [2001, 11, 22, 12, 23, 55], 16722, 433], ["Signature.m", [2001, 11, 22, 12, 23, 56], 17155, 404], ["dPSBasis.m", [2001, 11, 22, 12, 23, 51], 16267, 55], ["powerN.m", [2001, 11, 22, 12, 24, 19], 18866, 200], ["PS.m", [2001, 11, 22, 12, 6, 33], 1, 15007], ["Darboux.m", [2001, 11, 22, 12, 23, 50], 15584, 269], ["PSDop.m", [2001, 11, 22, 12, 23, 52], 16322, 335], ["typos.m", [2001, 11, 22, 12, 23, 57], 17559, 749], ["EigenPval.m", [2001, 11, 22, 12, 23, 51], 15853, 273], ["PSBasis.m", [2001, 11, 22, 12, 23, 51], 16126, 141], ["nothas.m", [2001, 11, 22, 12, 23, 55], 16657, 65], ["unknownfunc.m", [2001, 11, 22, 12, 24, 16], 18308, 464], ["int.m", [2001, 11, 22, 12, 24, 18], 18772, 94]]

march('extractfile',"C:/TMP/PS.lib","PSIntFac.m","C:/TMP/PSIntFac.m")

interface(verboseproc=3);

1

print(PSIntFac)

proc (ode, n) local base, intfac, subs_Us_by_func, x, y, M, N, eq; n; base := PS(args, PSBasis); subs_Us_by_func := map(proc (u) options operator, arrow; rhs(u) = lhs(u) end proc, base); intfac := [PS(args, PSIntFac)]; if intfac = [`We could not find an integrating factor.`] then RETURN(`We could not find an integrating factor.`) end if; x := intfac[2]; y := intfac[3]; M := subs(subs_Us_by_func, intfac[4]); N := subs(subs_Us_by_func, intfac[5]); eq := diff(y(x), x) = subs(y = y(x), M/N); print(`For the FOODE in the form`); print(eq); print(`the integrating factor will be`); intfac := normal(subs(subs_Us_by_func, intfac[1])) end proc

 

 

Download why_extract_not_working.mw

Now when opening the extracted file PSIntFac.m it shows this (in the folder C:/TMP/)

M7R0
I)PSIntFacf*6$%$odeG%"nG6*%%baseG%'intfacG%0subs_Us_by_funcG%"xG%"yG%"MG%"NG%#e
qG6"F0C09%>8$-%#PSG6$9"%(PSBasisG>8&-%$mapG6$f*6#%"uGF06$%)operatorG%&arrowGF0/
-%$rhsG6#9$-%$lhsGFHF0F0F0F4>8%7#-F66$F8F"@$/FM7#%IWe~could~not~find~an~integra
ting~factor.G-%'RETURNG6#FT>8'&FM6#""#>8(&FM6#""$>8)-%%subsG6$F;&FM6#""%>8*-F_o
6$F;&FM6#""&>8+/-%%diffG6$-Fhn6#FYFY-F_o6$/FhnFap*&F]o"""Feo!""-%&printG6#%:For
~the~FOODE~in~the~formG-Fjp6#F\p-Fjp6#%?the~integrating~factor~will~beG>FM-%'no
rmalG6#-F_o6$F;&FM6#FgpF0F0F0F0

It seems Maple kepts the .m file in binary form.   Is it not supposed to convert it to plain text readable form, as the one which shows when using the command print() on the screen?  

Is there another march command to extract the .m files in plain text form? I looked at help of march, but see nothing so far.

If this is how march extractfile is supposed to work, then is there another way to extract in plain text?

Please Wait...