mkdir -p dir cd dirCopied!
rim -k lsdir
Copied!
cat << 'EOF' > dir.rim begin-handler /dir public get-param path type string, indent type number default-value 0 // Get current directory where command-line program executes get-sys directory to cdir // Add the path to it where we want to list directory entries, and open directory open-dir cdir+"/"+path dir-id d // In a loop, read all directory entries start-loop read-dir d to e status s type t if-true s not-equal RIM_OKAY break-loop // exit the loop if no more end-if if-true t not-equal RIM_UNKNOWN // Skip . and .. if-true e not-equal "." and e not-equal ".." // Print space indentation for a nicer output call-handler "/dir/show-indent" set-param indent // Print the entry (file, directory, etc.) if-true t equal RIM_FILE print-out "File: "+e new-line else-if t equal RIM_DIR print-out "Dir: "+e new-line // If directory, call this service again with the path, and // make it indented call-handler "/dir" set-param path=path+"/"+e, indent=indent+4 else-if print-out "Other:"+e new-line end-if end-if end-if end-loop close-dir d // close each directory (without it, RimStone would do it automatically) end-handler // A very simple service to output a number of spaces begin-handler /dir/show-indent get-param indent type number start-loop repeat indent print-out " " end-loop end-handler EOFCopied!
rim -q
Copied!
mkdir -p dirtest mkdir -p dirtest/dir1 mkdir -p dirtest/dir2 mkdir -p dirtest/dir2/dir3 echo "hi"> dirtest/dir2/dir3/file3 echo "hi"> dirtest/dir2/file2 echo "hi"> dirtest/fileCopied!
rim -r --req="/dir/path=dirtest" --exec --silent-headerCopied!
File: file
Dir: dir1
Dir: dir2
Dir: dir3
File: file3
File: file2
Copied!
rim -r --req="/dir/path=..%2F" --exec --silent-headerCopied!