find_in_path.pro
来自「IDL语言编写的用于天文自适应光学仿真的软件CAOS V6.0的第一部分。」· PRO 代码 · 共 47 行
PRO
47 行
; $Id: find_in_path.pro,v 1.1 2002/03/22 15:14:58 riccardi Exp $;;+; FIND_IN_PATH;; The function searches a file in all the directories specified; in the !PATH system variable;; SYNTAX;; res = find_in_path(filename, /VERBOSE);; INPUTS;; filename: scalar string. File name to search for. only the; filename without any path. Wild characters are allowed.;; OUTPUT;; res: empty string ("") if no file has been found. Vector of; strings containing the results of the search if; successful.;; HISTORY;; 22 Mar 2002: Written by A. Riccardi; Osservatorio Astrofisico di Arcetri, Italy; riccardi@arcetri.astro.it;;-function find_in_path, filenameif !version.os_family eq "Windows" then delim = ';' else delim = ':'dirs = strsplit(!PATH, delim, /EXTRACT)nd = n_elements(dirs)res = [""]for id=0,nd-1 do begin fn = findfile(filepath(ROOT=dirs[id],filename)) if fn[0] ne "" then res=[temporary(res),fn]endforif n_elements(res) gt 1 then return, res[1:*] else return, resend
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?