opendir Questions
6
Solved
Which is faster between glob() and opendir(), for reading around 1-2K file(s)?
4
Solved
I am making a program which is run in a Linux shell, and accepts an argument (a directory), and displays all the files in the directory, along with their type.
Output should be like this:
<&l...
4
Solved
I have a folder called allfiles, and there are some files in this folder, such as
1212-how-to-sddk-thosd.html
3454-go-to-dlkkl-sdf.html
0987-sfda-asf-fdf-12331.html
4789-how-to-fdaaf-65536.htm...
4
Solved
I am accepting the path through command line input.
When I do
dir=opendir(args[1]);
it doesn' t enter the loop...i.e dir==null...
How do I pass the command line input to dir pointer?
void mai...
2
I have tried:
function random_pic($dir = '../myfolder') {
$files = opendir($dir . '/*.*');
$file = array_rand($files);
return $files[$file];
}
This function works using glob() but not opendir...
3
I use opendir() to open a directory and then readdir() and lstat() to get the stats of each file in that directory. Following this manpage I wrote the code under which doesn't work as thought. It d...
6
Solved
I would like to use opendir() to list only the folders in a particular folder (i.e. /www/site/). I would like to exclude files from the list as well at the '.' and '..' folders that appear on a lin...
7
Solved
I'm using the following PHP code to list all files and folders under the current directory:
<?php
$dirname = ".";
$dir = opendir($dirname);
while(false != ($file = readdir($dir)))
{
if(($...
5
Solved
I'm using opendir function to check if a directory exists. The problem is that I'm using it on a massive loop and it's inflating the ram used by my app.
What is the best (fastest) way to check if ...
Preponderance asked 16/2, 2012 at 16:2
4
Solved
What should be done to get titles (eg abc.jpg) of images from a folder/directory using PHP and storing them in an array.
For example:
a[0] = 'ac.jpg'
a[1] = 'zxy.gif'
etc.
I will be using the...
3
Solved
opendir MYDIR, "$dir";
my @FILES = readdir MYDIR;
closedir MYDIR;
It appears that 99.9 % of the time the first two entries in the array are always “.” and “..”. Later logic in the script has i...
1
© 2022 - 2024 — McMap. All rights reserved.