Bulk extraction of all workspaces used in a legacy app
Posted: Wed Jun 26, 2024 12:19 pm
Hello,
I have to manage legacy applications written in APL for my company. The app is composed by more than 100 separate workspaces (mainly one for each input source, one that combine all the cleaned data and few other ones used to disseminate and build GUIs for end-users).
As I am a beginner in APL, I don't want to change the core engine for now but I would like at least to push everything in a git. I noticed that years after year, some element have been stored/duplicated in different places. So, I would like to do some clean-up but with the possibility to track and restore if something goes wrong. In this context, pushing everything into a git would be a big plus.
As I have a lot of workspaces involved, I cannot do by hand. So, I tried to due first with dyalogscript but I didn't succeed. So I have created a batch file as follows:
The unix script loops in a source folder and do a specific action for each workspace. It is working but –loadfn option fails and I didn't succeed to generate a load_ws.dyalog file with this command. Do you know how to fix that?
]SNAP is still the best method for extracting all info from a workspace? I tried CreateProject but it seems to be interactive and I need to do in bulk (the batch mode was not working in my case).
I have to manage legacy applications written in APL for my company. The app is composed by more than 100 separate workspaces (mainly one for each input source, one that combine all the cleaned data and few other ones used to disseminate and build GUIs for end-users).
As I am a beginner in APL, I don't want to change the core engine for now but I would like at least to push everything in a git. I noticed that years after year, some element have been stored/duplicated in different places. So, I would like to do some clean-up but with the possibility to track and restore if something goes wrong. In this context, pushing everything into a git would be a big plus.
As I have a lot of workspaces involved, I cannot do by hand. So, I tried to due first with dyalogscript but I didn't succeed. So I have created a batch file as follows:
Code: Select all
#!/bin/bash
INDIR="$PWD/_SANDBOX_"
OUTDIR="$PWD/_SANDBOX_UNICODE_"
rm -r $OUTDIR
for ws in `find $INDIR -type f \( -name "*.dws" -o -name "*.DWS" \)`
do
echo "WS: $ws"
NEWDIR=$(dirname -- "$ws")
NEWDIR=${NEWDIR/$INDIR/$OUTDIR}
echo $NEWDIR
mkdir -p $NEWDIR
cd $NEWDIR
filename=$(basename -- "$ws")
extension="${filename##*.}"
WS_name="${filename%.*}"
echo $WS_name
/usr/bin/dyalog -tty << END_OF_FILE
)xload $ws
]SNAP $NEWDIR/ -makedir
⍝ OK but no file generated to reload the ws
⍝ ]SNAP $NEWDIR/ -makedir –loadfn
⍝* Command Execution Failed: Unable to create file /home/viguice/Documents/_SAND
⍝ BOX_UNICODE_/ -makedir –loadfn/=AMECOINIT=.dyalog: /home/viguice/Document
⍝ s/_SANDBOX_UNICODE_/ -makedir –loadfn/=AMECOINIT=.dyalog: Unable to creat
⍝ e file
⍝ Based on https://dyalog.tv/Dyalog18/?v=w4Wp01-d3Rw but not working even using batch mode
⍝]CreateProject $NEWDIR/$WS_name #
)OFF
END_OF_FILE
done
]SNAP is still the best method for extracting all info from a workspace? I tried CreateProject but it seems to be interactive and I need to do in bulk (the batch mode was not working in my case).