sternlie@eniac.seas.upenn.edu (Paul E. Sternlieb) (04/05/91)
Is it possible to move a file or copy a file from one directory to another on the 48? Is it possible to move a file from one directory to another and rename in the process? Thanks. -- _____ / / / /_____/ ___ / / / / / / /
ASTA%DULRUU51.BITNET@CUNYVM.CUNY.EDU (04/08/91)
>Newsgroups: comp.sys.handhelds >Subject: Moving files between dirs? >From: sternlie@eniac.seas.upenn.edu (Paul E. Sternlieb) >Date: 4 Apr 91 21:20:11 GMT Lines: 191 > >Is it possible to move a file or copy a file from one directory >to another on the 48? LOAD: copy objects from your work-space ( := the dir ZZZ in HOME ) SAVE: copy objects to your work-space COPY: copy objects from your current directory to another directory (the selected objects remain in your current directory) MOVE: replace objects from your current directory to another directory (the selected objects are deleted in your current directory) OBSI: shows the size of objects in Bytes. You can determin the size of any object(list), as well the size of directories. REPL: replace a substring with another substring in an object (the object can also be a none-string: a program etc). The 2 substrings haven't to be the same size. SDIR: sort the directory in alphabetical order QS: Quicksort a list or an array (you can specify which column is the key for sorting) First, type in: HOME 'ZZZ' CRDIR Usage of LOAD and SAVE: ----------------------- <global name> LOAD <list of global names> LOAD <global name> SAVE <list of global names> SAVE eg: 'TEST' SAVE { 'TEST1' 'NEXT' 'ANOTHER' } SAVE 'TEST' LOAD { 'TEST1' 'NEXT' 'ANOTHER' } LOAD You can also load/save whole subdir-trees! Usage of MOVE and COPY: ----------------------- <global name> COPY [now travel to the destination directory] CONT [:= SHIFT 1] <list of global names> COPY [now travel to the destination directory] CONT [:= SHIFT 1] <list of global names> MOVE [now travel to the destination directory] CONT [:= SHIFT 1] <list of global names> MOVE [now travel to the destination directory] CONT [:= SHIFT 1] eg: { 'TEST1' 'NEXT' 'SUBDIR1' } COPY HOME CONT You can also copy/move whole subdir-trees! Usage of REPL COPY: ------------------- 3: <string1> 2: <string2> 1: <any object> REPL (replaces any occurence of string1 with string2 in the object) eg: "^" 33 CHR "That's it^^" REPL "DUP OVER +" "SWAP -" 'doit' REPL Usage of QS: ------------ 1: <list> or <vector> QS 2: <array> 1: <integer> QS eq: { "blubber" "foo" "bar" } QS [[ 1.1 3.4 8 ] [ -2 4 8.8 ] [ 3 0 0.1 ] [ 0 -4 -8 ]] 2 QS ----------------------------------------------------------------------------- | General Student Board | asta@rz.uni-ulm.de | asta@rz.uni-ulm.dbp.de | | c/o Ulli Horlacher | asta@dulruu51.bitnet | 50184::asta (DECnet/BelWUe) | | University of Ulm | ----------------------------------------------------| | D-7900 Ulm, Germany | "Waiting for the prompt" -Marillion | ----------------------------------------------------------------------------- -----schnippel-----cut_here-----reiss------beiskante-----hau_wech-----fetz----- %%HP: T(3)A(R)F(.); DIR COPY \<< 8 CF \->CML HALT \->CMS \>> LOAD \<< 8 CF PATH \-> p \<< ZZZ \->CML p EVAL \->CMS \>> \>> MOVE \<< 8 SF \->CML HALT \->CMS \>> SAVE \<< 8 CF PATH \-> p \<< \->CML ZZZ \->CMS p EVAL \>> \>> \->CML \<< \->O\->L DUP \-> ol \<< 1 SWAP SIZE FOR i ol i GET DUP RCL IF 8 FS? THEN OVER IFERR PURGE THEN PGDIR END END SWAP NEXT 1 ol SIZE 2 MENU \>> \>> \->CMS \<< START IFERR STO THEN DUP DUP \->STR 1 OVER SIZE 1 - SUB ".b" + OBJ\-> REN STO END NEXT \>> DIR\-> \<< DUP EVAL VARS 8 SF \->CML UPDIR \->CMS PURGE \>> \->O\->L \<< IFERR LIST\-> THEN 1 END \->LIST \>> ZZZ\-> \<< path EVAL 2 MENU \>> \->ZZZ \<< PATH HOME 'path' STO ZZZ 2 MENU \>> OBSZ \<< 0 \-> X \<< \->O\->L OBJ\-> 1 SWAP START BYTES 'X' STO+ DROP NEXT X \>> \>> SDIR \<< VARS 1 OVER SIZE FOR i i DUP2 GET DUP RCL IF TYPE 15 == THEN " " ELSE "" END SWAP \->STR + PUT NEXT QS 34 CHR "" ROT REP ORDER RY \>> QS \<< 9 CF 1 CF DUP \->STR DUP "[[" POS SWAP "{ {" POS OR 1 IFT IF DUP TYPE 0 == THEN 9 SF SWAP DUP IF DUP TYPE 3 == THEN 1 SF A\<-\->L SWAP TRN A\<-\->L ELSE LTRN END ROT GET SWAP 's0' STO END 's' STO 1 s SIZE IFERR LIST\-> DROP THEN END \->QS IF 9 FS?C THEN s0 IF 1 FS?C THEN A\<-\->L END ELSE s END { s0 s k } PURGE \>> \->QS \<< DUP2 DUP2 + 2 / s SWAP GET \-> l r l1 r1 x \<< DO WHILE s l1 GET x < REPEAT l1 1 + 'l1' STO END WHILE x s r1 GET < REPEAT r1 1 - 'r1' STO END IF l1 r1 \<= THEN 's' r1 s l1 GET 's' l1 s r1 GET PUT PUT IF 9 FS? THEN 's0' r1 s0 l1 GET 's0' l1 s0 r1 GET PUT PUT END l1 1 + 'l1' STO r1 1 - 'r1' STO END UNTIL l1 r1 > END IF l r1 < THEN l r1 \->QS END IF l1 r < THEN l1 r \->QS END \>> \>> REP \<< 1 CF ROT \->STR ROT \->STR ROT IF DUP TYPE 6 == THEN DUP 4 ROLLD RCL 1 SF END DUP 4 ROLLD \->STR \->REP IF SWAP TYPE 2 \=/ THEN STR\-> END IF 1 FS?C THEN SWAP STO END \>> \->REP \<< ROT ROT 0 \-> a b z \<< WHILE DUP DUP a POS DUP 'z' STO REPEAT 1 z 1 - SUB b + SWAP z a SIZE + OVER SIZE SUB + END DROP \>> \>> END