follow (2) --- path name follower 07/08/83 | _C_a_l_l_i_n_g _I_n_f_o_r_m_a_t_i_o_n integer function follow (path, sethome) character path (ARB) integer sethome Library: vswtlb (standard Subsystem library) _F_u_n_c_t_i_o_n | 'Follow' changes the current working directory. 'Path' is a | pathname assumed to be composed of nodes that are only UFDs, | with no data files or segment directories. 'Follow' | "attaches" (Primos terminology) to each of the directories | and subdirectories named in the pathname in sequence, thus | "following" a path through the file system to the last | directory named. 'Sethome' is a set-home key; if zero, the | home directory remains unchanged, and the pathname specifies | a new working directory; if 'sethome' equals one, the path- | name specifies a new home directory. | 'Follow' returns ERR if there was a syntax error in the | pathname or if a directory could not be attached, and OK if | the attach was successful. _I_m_p_l_e_m_e_n_t_a_t_i_o_n | 'Follow' sets up an on-unit for the "BAD_PASSWORD$" condi- | tion in order to handle errors during the attaching process. | If the pathname supplied is empty, 'follow' attaches back to | the home directory by calling the Primos routine AT$HOM. Otherwise, 'follow' calls the routine 'getto' to reach the | parent directory of the last directory in the path, and then | calls the Primos routine AT$REL to take the final step in the path. If 'getto' fails to parse the pathname or reach | the parent directory or if AT$REL encounters an error, 'fol- | low' attaches back to the home directory and returns ERR; if | successful it returns OK. _C_a_l_l_s | bponu$, ctov, ptoc, getto, Primos at$hom, Primos at$rel, | Primos break$, Primos mklb$f, Primos mkonu$ _S_e_e _A_l_s_o getto (2), cd (1) follow (2) - 1 - follow (2)