Skip to content

Commit ab5e423

Browse files
committed
Update cc-scripting.md
1 parent cd58ecb commit ab5e423

1 file changed

Lines changed: 58 additions & 2 deletions

File tree

docs/crystal-chips/cc-scripting.md

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,17 @@ File manipulation is useful for installation scripts (in APPINFO.PBT). You can m
267267
#### COPY
268268
To copy file/directory from source to destination :
269269

270-
```COPY "host:/FOLDER/FILE.TXT" "mass:/FOLDER1/FOLDER2/FILE.TXT"```
270+
```COPY "host:/FOLDER/FILE.TXT" "mass:/FOLDER1/FOLDER2/FILE.TXT"``` will copy the single file, but will not create destination folder structure.
271+
272+
```COPY "host:/FOLDER" "mass:/FOLDER/FOLDER2"``` will copy contents source folder to destintaion folder
273+
274+
Notes: copying a file to a file only works if prior directories already exist on destination.
275+
276+
```COPY "host:/FOLDER" "mass:/FOLDER1/FOLDER2/FILE.TXT"``` DOES NOT WORK
277+
278+
```COPY "host:/FOLDER" "mass:/FOLDER1/FOLDER2/"``` This does work to create an empty mass:/FOLDER1 but will say it fails if used with ```IF COPY FAIL```
279+
280+
271281

272282
#### RM
273283
To delete a file or directory
@@ -288,6 +298,20 @@ To create a new folder.
288298

289299
will create a folder MYFOLDER in the USB mass storage.
290300

301+
Note: MKDIR will not create mutliple folders for example:
302+
```
303+
IF NOT EXISTS "mass:/MYFOLDER/FOLDER2/FOLDER3"
304+
IF FAIL MKDIR "mass:/MYFOLDER/FOLDER2/FOLDER3"
305+
MESSAGE "FAILED TO CREATE DIRECTORY!"
306+
ENDIF
307+
ENDIF
308+
```
309+
310+
The workaround is to exploit a bug that thinks it failed
311+
312+
```COPY $PWD$ "mass:/MYFOLDER/MYFOLDER2/MYFOLDER3"``` DO NOT PRECEDE WITH `IF FAIL` as it does think it failed. Contents of folders will not be harmed in my testing if some of it exists.
313+
314+
291315
#### REDIRFILE
292316
To symlink a file to another location. Only works if the environment you use doesn't reboot IOP too soon IE PS2LINK
293317

@@ -388,4 +412,36 @@ LOADIMG/UNLOADIMG - load and unload an image for theming
388412

389413
```*``` wildcard(s)
390414

391-
```?``` single character wildcard
415+
```?``` single character wildcard
416+
417+
#### Useful Tips
418+
419+
When debugging paste variables where you want in the script. Then run PS2Client to see output via ECHO
420+
421+
```
422+
PARSEPATH "$PWD$" "SRC_DEV" "SRC_PATH" "SRC_FILE"
423+
424+
ECHO ""
425+
ECHO ""
426+
ECHO "PWD: $PWD$"
427+
ECHO "SRC_DEV: $SRC_DEV$"
428+
ECHO "SRC_PATH: $SRC_PATH$"
429+
ECHO "SRC_FILE: $SRC_FILE$"
430+
ECHO "ARG0: $ARG0$"
431+
ECHO "ARG1: $ARG1$"
432+
ECHO "ARG2: $ARG2$"
433+
ECHO "ARG3: $ARG3$"
434+
ECHO "ARG4: $ARG4$"
435+
ECHO "ARG5: $ARG5$"
436+
ECHO ""
437+
ECHO ""
438+
```
439+
440+
#### PS2Client
441+
442+
Paste and edit this text into plain text file saved as LauchBM2.bat
443+
```ps2client -h IPADDRESS execee host:/BM/BM2.ELF```
444+
445+
In the folder that has PS2Client, paste your BM folder
446+
447+
You can then edit the scripts, and reload menu on Crystal Chip BootManager to see your changes

0 commit comments

Comments
 (0)