directory-listing

Get the contents of a server-side directory in SAP ABAP

I need to get a listing of a server-side directory inside SAP. How do I achieve this in ABAP? Are there any built-in SAP functions I can call? Ideally I want a function which I can pass a path as input, and which will return a list of filenames in an internal table. ...

Recursive directory listing using Ruby with Chinese characters in file names

I would like to generate a list of files within a directory. Some of the filenames contain Chinese characters. eg: [试验].Test.txt I am using the following code: require 'find' dirs = ["TestDir"] for dir in dirs Find.find(dir) do |path| if FileTest.directory?(path) else p path end end end Running the script...

How do I use File::Find::Rule in taint mode?

I am trying to get a list of subdirectories in a given directory using something like the following: #!/usr/bin/perl -wT use strict; use warnings; use File::Find::Rule; use Data::Dumper; my @subdirs = File::Find::Rule->maxdepth(1)->directory->relative->in('mydir'); print Dumper(@subdirs); However, running this gives the result: ...

Simple script to replace Apache's mod_autoindex with a user-friendly directory listing

The Apache module mod_autoindex generates "directory indexes" that show users a crude hyperlinked list of the files and directories inside a directory (when there is no index.html or other DirectoryIndex file). I have a directory on an Apache webserver where I want to provide an automatic directory listing, including the full filenames,...

Download files from a directory listing.

Is it possible to download all the files from a directory listing? Eg., the following link leads to a listing. http://www.arthika.net/1234TB/new/Kuruvi/ Please point me to some related API's to download all the files from such listings (if possible). Thanks ...

Recursively List all directories and files

Hi I would like to recieve the following output - Suppose the directory structure on the file system is like this: -dir1 -dir2 -file1 -file2 -dir3 -file3 -file4 -dir4 -file5 -dir5 -dir6 -dir7 The output from the script must be like: Directories: /dir1 /dir1...

Directory Walker for Python

I am currently using the directory walker from Here import os class DirectoryWalker: # a forward iterator that traverses a directory tree def __init__(self, directory): self.stack = [directory] self.files = [] self.index = 0 def __getitem__(self, index): while 1: try: file = self.files[self.index] ...

listing a folder content : how to prevent user from going above the authorized directory?

Hi, i'm working on a script to allow users to browse a given directory, which is not the directory this file is sitting in, but set in a variable. define('FOLDER', '../_files/'); Now, the rendred html allows to navigate subfolders inside that folder. I use a "dir" GET variable to tell my script which subfolder's content to display a...

How to stop Apache from listing the contents of my user directories

I recently ran some penetration testing software on my web site and was surprised for it to report that one of my directory listings was publicly accessible. It is the directory of the root user which is available. http://www.example.com/~root/ Results in this page content: Index of /~root * Parent Directory * cgi-bin/ Pla...

Getting a list of folders in a directory

How do I get a list of the folders that exist in a certain directory with ruby? Dir.entries() looks close but I don't know how to limit to folders only. ...

PHP/Apache, options +indexes in htaccess doesn't work for root directory

I need to offer a directory listing of the root directory of my site, so I created an .htaccess file containing options +indexes It works for subdirectories, but for the main directory I get the Test Page for the Apache HTTP Server on Red Hat Enterprise Linux page. I have two sites that are identical except for the PHP version insta...

Java Shell wildcard tokenizer

My Java is extremely rusty and I'm stuck trying to make a user interface that simplifies the execution of shell scripts or batch files depending on whether it's Linus or Win32 respectively. The files have the following naming convention. module-verb-object-etc [args-list] mysql-connect-grid mysql-connect-rds mysql-dump-grid m...

to display the only the folder names as a list in IE

Hi, My requirement is to list out all the folder names in a folder in IE. The subfolder and the main folder often changes and I wanted them to be manually update in a list when i open the IE. Also, the folder names should be hyperlinked to the folder so that i can click the link in the IE to get access to the file. Can anyone help me...

Recursive directory listing in dos

How do we achieve recursive directory listing in DOS? I'm looking for a command or a script in DOS which can give me the recursive directory listing similar to ls -R command in unix. ...

read the contents of a directory using shell script

Hi, I'm trying to get the contents of a directory using shell script. My script is: for entry in `ls`; do echo $entry done However, my current directory contains many files with whitespaces in their names. In that case, this script fails. What is the correct way to loop over the contents of a directory in shell scripting? PS:...

How to get the list of files in a directory in a shell script?

Hi, I'm trying to get the contents of a directory using shell script. My script is: for entry in `ls $search_dir`; do echo $entry done where $search_dir is a relative path. However, $search_dir contains many files with whitespaces in their names. In that case, this script does not run as expected. I know I could use for entry i...

htaccess, directory listing, and ip addresses

Is there a way with htaccess to allow a directory listing of a folder only for a specific ip address and deny directory listing access to everyone else? ...

List files that don't match a string in bash

Dear all, I'm a newbie in bash and I would like to pass as parameter to a python function all files in a directory that don't match a given pattern. sth. like: $myscripts/myprog.py $myfiles/!(bonjovi) The above example should retrieve all files that don't match to "bonjovi". Best wishes ...

IIS Directory listing doesn't reconize .mkv files

Hello I use the directory listing function in IIS to upload a bunch of files for friends and family to easy access and download. My problem is that .mkv files it lists but when you click it i get a 'The page cannot be found'. Ive tried relocating the file and renaming it but i get the same error each time. Why does it do this? Its onl...

File explorer java

I'd like to have some kind of file browser like Windows Explorer inside a Java Application. I just want something that's able to list file inside a folder recursively. Is there a simple way to do this ? I already tried to use JFileChooser but it's not what I want. ...