Questions tagged [readdir]

The C, Perl or PHP library function for reading from an open directory.

The readdir C library function reads and returns the next entry, as a struct dirent *, from an open DIR *. You should open the directory using opendir first. This can also refer to the Perl or PHP functions with the same purpose.

Links:

301 questions
0
votes
2 answers

will the php readdir function work with 1 million files in a single directory?

I am writing a script that needs to scan through a large amount of files (potentially up to 1 million) in a single directory (ext4). I am planning on using the PHP readdir function to create the list. Since I don't have that amount of files in the…
user1227914
  • 3,446
  • 10
  • 42
  • 76
0
votes
1 answer

how to get all image using php readdir method?

am using readdir to get all the image from the folder like function get_user_image($valid_user){ $rootdir = "../../../user/".$valid_user; $dir = opendir("../../../user/".$valid_user); $image = array(); scan_image($image,$rootdir); …
paynestrike
  • 4,348
  • 14
  • 46
  • 70
-1
votes
1 answer

TypeError: Cannot read properties of undefined (reading 'readdir')

Please help me the text of the error I get in the terminal: fs.readdir("./komutlar/",(err,files) => { ^ TypeError: Cannot read properties of undefined (reading 'readdir') at Object. (C:\Users\tDiff\Desktop\TDIFF\tdıff.js:15:4) enter code here const…
tDiff
  • 1
  • 1
  • 3
-1
votes
2 answers

How to read filenames 10 at a time, process them, then read the next 10?

In Perl, how do I read filenames in a directory into a Perl array only 10 at a time? All directory reading solutions I have found seem only to read the entire list of files into an array at once, but I don't want to read all files at once because…
skeetastax
  • 1,016
  • 8
  • 18
-1
votes
1 answer

Using node 'fs' module and 'readdir' method using AMD

I need to loop through a folder (the data folder in my application) and get file names in a javascript application. The application is not setup as a Node.js application per se ( although I have npm and node.js installed on my computer). It seems…
gwydion93
  • 1,681
  • 3
  • 28
  • 59
-1
votes
1 answer

Seg. Fault and not sure why

I am not sure why I am getting a seg fault. I know it is somewhere in my pidspec function but I'm not sure why it is happening. The goal of this program is to have the process id passed in as first argument to program, from there, the pid is…
-1
votes
1 answer

Recursive directory listing using promises in node js

I want to recursively list the directories and read the files inside it using promises in node.js. Can someone please help me to get over this ?
-1
votes
2 answers

Saving argv[1] to a char* variable causes seg fault when passed to separate function

I'm trying to rewrite a stripped down version of the "ls" command in C. I originally had everything being done in my main() which worked fine and resulted in no seg faults. Literally all I did was copy and paste the bulk of my main into a new…
jiccan
  • 89
  • 12
-1
votes
1 answer

Issues getting images from a folder and using a path for href and image source

I'm new to PHP and having some troubles. I need to get some images to display as:
user3799112
  • 71
  • 12
-1
votes
3 answers

Warning: opendir(): The system cannot find the file specified. (code: 2)

I'm trying to turn the files in my 'objects' directory into an array, then use them to load the objects. But, for some reason, I continue to get this error Warning: opendir(C:\xampp\htdocs/objects,C:\xampp\htdocs/objects): The system cannot find…
user3656876
  • 1
  • 1
  • 2
-1
votes
3 answers

php function to read subdir content

I would like to ask what I have to add to make this function to show not only the files on top dir but also the files in subdirs.. private function _populateFileList() { $dir_handle = opendir($this->_files_dir); if (! $dir_handle) { …
kos
  • 1
-2
votes
1 answer

How to extract a directory recursively?

I'm trying to extract a directory recursively using the function below. When I run the program it is able to create a root directory and the files inside of it but it is not able to completely write the files inside of the sub directories. My code…
JonSnow
  • 67
  • 3
  • 14
-2
votes
1 answer

PHP readdir while loop don't work cleanly

I wrote a short php code that displays an image and the titke to every file in a directory. The problem is that if i run the code many files get the a instead of an image. So for example a .zip file is in front of a .txt file. Now it will display…
-2
votes
3 answers

How do I use scandir (or another method) to sort the directory results alphabetically?

Not skilled with PHP at all. I used old code from another site (that I did not write) to create a CMS for a client. Problem is, the directory results here are not returned alphabetically. I have read that scandir will do that, whereas readdir will…
-3
votes
1 answer

64-bit opendir and readdir in C++Builder

I'm using the VCL tools in C++Builder 11 for Windows desktop development. I am trying to get the C functions opendir and readdir to work in a 64-bit app. I have read the IBM website (link below) about the 64-bit version of opendir and readdir but I…
homebase
  • 713
  • 1
  • 6
  • 20
1 2 3
20
21