Questions tagged [opendir]

A PHP, PERL, C library function for opening a directory handle. Questions are about the workings or issues with the opendir function.

The opendir() function is used to open up a directory handle to be used in subsequent closedir(), readdir(), and rewinddir() calls.

Links:

Related

262 questions
-1
votes
4 answers

C - opendir + fopen

I would like to know if it is possible to open a directory and then work with fopen to open a file from it. Like in the example: I have a MAINDIR and inside of it I have file.txt so I would like to do the following: void openFile(const char *…
-1
votes
1 answer

php image resize code and high cpu usage

I have the following php code which resizes images in cbimages folder and creates thumbnail images in another folder cbimages/thumbs/
user3790186
  • 239
  • 6
  • 21
-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
-4
votes
3 answers

opendir php error with variables

Can someone tell me what is wrong with this code? UserFullName(); $handle = opendir('/users/$user/'); ?> This is the error message: opendir(/app/$user/) [function.opendir]: failed to open dir: No such file or…
Josh
  • 2,835
  • 1
  • 21
  • 33
-4
votes
1 answer

opendir() failed to open dir, not impemented in

I'm trying to write some php to make an image slideshow from a file on a server. When I try to opendir it gives me the error in the title $images = glob('*.{jpg,jpeg,png,gif}', GLOB_BRACE); $count = count($images); $var_count = $count + 1; $arr_img…
-4
votes
2 answers

Select random file using OPENDIR()

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. This returns a failed to open directory…
Norse
  • 5,674
  • 16
  • 50
  • 86
-5
votes
2 answers

readdir() attempted on invalid dirhandle

What am I doing wrong? I've tried many things but can't seem to read from this file. Thanks! my $d = 'URLs.txt'; open(my $fh, '<:encoding(UTF-8)', $d) #opendir(D, "$d") || die "Can't open directory $d: $!\n"; or die "Can't open directory $d:…
Kevin
  • 1
  • 1
1 2 3
17
18