localhost上的目录列表 [英] Directory listing on localhost

查看:121
本文介绍了localhost上的目录列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是脚本新手。我正在寻找一种方法,使用正则表达式在

目录中查找文件名。我没有客户端 - 服务器设置

,即我想要搜索的目录是本地的(脚本所在的同一目录

)。用什么函数逐一列出目录中的文件
目录中的文件,以便我可以将文件名与常规

表达式匹配(比如查找所有以profile_5)。任何

建议/指示将非常欢迎。

感谢您的帮助。

解决方案

在文章< bo ********** @ prometheus.acsu.buffalo.edu>中,rg27

@ cse.buffalo.edu启发我们。 ..

我是脚本新手。我正在寻找一种使用正则表达式在
目录中查找文件名的方法。我没有客户端 - 服务器设置
,即我要搜索的目录是本地的(脚本所在的目录
)。使用哪些函数逐个列出目录中的文件,以便我可以将文件名与常规表达式匹配(比如查找以profile_5开头的所有文件)。任何
建议/指示将非常欢迎。
感谢您的帮助。



您不能使用正常的客户端JavaScript 。 ActiveX,WSH或COM将

(可能)让你,依赖于浏览器和安全允许。


你使用什么浏览器和操作系统?此外,这是在你的

机器还是网络服务器上运行?

-------------------- -----------------------------

~kaeli~

耶稣救了,Allah保护,和Cthulhu

认为你会做一个漂亮的三明治。
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

------------------------ -------------------------


kaeli写道:

你不能使用普通的客户端javascript。 ActiveX,WSH或COM将(可能)让您,依赖于浏览器和安全性允许。

您使用的浏览器和操作系统是什么?此外,这是在您的
机器还是网络服务器上运行?




感谢您的回复。我使用的是Windows 2000和IE6。脚本是

在我的机器上运行。举个例子说我的硬盘上有一个名为

display.html的文件。当我将该文件加载到

浏览器中时(在地址栏中使用file://)我想看到一个符合模式的文件列表

(比如开头)与abc)在

display.html所在的目录中。这个目录是本地的。所以基本上我希望

脚本与本地文件系统进行交互并进行一些文件名匹配。


试用Perl

I am new to scripting. I am looking for a way to find a filename in a
directory using regular expressions. I do not have a client-server setup
i.e. the directory that I want to search in is local (the same directory
in which the script resides). What functions are used to list one by one
the files in a directory so that I may match the filename with a regular
expression (say to find all files which begin with profile_5). Any
suggestions/pointers will be highly welcome.
Thank you for your help.

解决方案

In article <bo**********@prometheus.acsu.buffalo.edu>, rg27
@cse.buffalo.edu enlightened us with...

I am new to scripting. I am looking for a way to find a filename in a
directory using regular expressions. I do not have a client-server setup
i.e. the directory that I want to search in is local (the same directory
in which the script resides). What functions are used to list one by one
the files in a directory so that I may match the filename with a regular
expression (say to find all files which begin with profile_5). Any
suggestions/pointers will be highly welcome.
Thank you for your help.


You can''t with normal client-side javascript. ActiveX, WSH, or COM would
(might) let you, browser-dependent and security allowing.

What browser and OS are you using? Also, is this running on your
machine, or a web server?
-------------------------------------------------
~kaeli~
Jesus saves, Allah protects, and Cthulhu
thinks you''d make a nice sandwich.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------


kaeli wrote:

You can''t with normal client-side javascript. ActiveX, WSH, or COM would
(might) let you, browser-dependent and security allowing.

What browser and OS are you using? Also, is this running on your
machine, or a web server?



Thank you for your reply. I am using Windows 2000 and IE6. The script is
to be run on my machine. As an example say I have a file called
display.html on my hard drive. When I load that file into the
browser(using file:// in the address bar) I want to see a list of files
which match a pattern (say beginning with abc) in the directory in which
display.html resides. This directory is local. So basically I want the
script to interact with the local filesystem and do some filename matching.


Try Perl


这篇关于localhost上的目录列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆