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
vote
1 answer

Calculate the weight of a directory (folder) in php

I am wanting to calculate the weight of a directory in php, then display the data as per the example below. Example: Storage 50 GB (14.12%) of 353 GB used I have the following function, with which I show in a list the folders that are inside the…
Armin
  • 15
  • 5
1
vote
1 answer

Reading only .txt files from an input directory, then getc all contents into one array in C

So I am attempting to make a function that receives an input directory, examine only its ".txt" files and then store ALL contents into one character array (dynamically allocated, here). As I use getc() on every character in each file, one at a…
PluffTed
  • 53
  • 5
1
vote
1 answer

Add all cwd directories to an array, iterate directory by directory and open-save only .xlsm files in there (Windows 10)

Goal: Add all directories to an array, iterate directory by directory and open-save only .xlsm files in there. (when they are opened a vba macro is executed automatically) Error: Uncaught exception from user code: Opening of directory…
timunix
  • 609
  • 6
  • 19
1
vote
2 answers

Why does opendir() change the file path string passed to it?

I am trying to write a function given a current working directory will print all the contents of that directory as well as the contents in the sub directories in the cwd. void printDir(char *cwd) { printf("file path after printdir call:…
1
vote
2 answers

Perl, Reading dir and getting stat() for each file

In Perl, When I'm trying to read dir in a loop, and perform for each file stat() in order to get $size and $mode, I get wrong data! For example, I just created simple text file and it shows me it has permission 0000 and no size. Perl Code: if…
marverix
  • 7,184
  • 6
  • 38
  • 50
1
vote
3 answers

Problem with directories in C

I'm making a program for Linux in C that recieves a directory as an argument, then for each file in that directory and each of it's sub-directories, calls a program called monfile. Here's the code: #include #include #include…
Mr eskimo
  • 41
  • 1
1
vote
1 answer

Open() system call for directories and accessing files in sub-directories

I'm trying to open a directory and access all it's files and sub-directories and also the sub-directories files and so on(recursion). I know i can access the files and the sub-directories by using the opendir call, but i was wondering if there is a…
judy
  • 27
  • 1
  • 6
1
vote
3 answers

PHP - opendir on another server

I'm kinda new to PHP. I've got two different hosts and I want my php page in one of them to show me a directory listing of the other. I know how to work with opendir() on the same host but is it possible to use it to get access to another machine?…
Auxiliary
  • 2,687
  • 5
  • 37
  • 59
1
vote
1 answer

python equivalent of perl's "opendir"

What I am essentially looking for is a way to return a handle to a directory in python, a bit like how perl can do something like this... opendir CWD . see: http://perldoc.perl.org/5.8.9/functions/opendir.html CWD can then be used as a handle for…
Mike H
  • 11
  • 2
1
vote
0 answers

PHP opendir on smb mounted server

I am trying to opendir on a SMB mounted server. I'm running XAMPP on a Mac. I keep getting "No such file or directory" but i can cd to the directory just fine from terminal using the same path. $dir = opendir("/Volumes/photorepos/Partners"); echo…
1
vote
1 answer

how to list names of all files from selected directory and subdirectories with in directory using tkinter

how to list names of all files from selected directory and sub directories with in directory using tkinter. Here is my code . def openDirectory(self): self.dirname = tkFileDialog.askdirectory(parent=self.root, initialdir='/home/',…
Muhammad
  • 33
  • 10
1
vote
1 answer

Editing vbscript while looping through folder path - PHP

I have a php code that will loop through my file folder and edit my vbscript at the same time. My code is working but not the way I expected. Here are the contents of my Samplefolders: Here is my VB Script Code: Option Explicit Dim oFSO,…
Rukikun
  • 271
  • 3
  • 19
1
vote
3 answers

Is this PHP opendir() very taxing on the server?

if (is_dir($dir)) { if($handle = opendir($dir)) { while($file = readdir($handle)) { // Break the filename by period; if there's more than one piece, grab the last piece. $parts = explode(".", $file); if…
Ian Storm Taylor
  • 8,520
  • 12
  • 55
  • 72
1
vote
1 answer

PHP opendir() not opening a subdirectory

I have made a php image gallery, which should list all the subdirectories of the of the "pics" folder and when clicked, show the first image in the folder with a link to the previous and next photos. When it lists the subdirectories of the "pics"…
Jonno_FTW
  • 8,601
  • 7
  • 58
  • 90
1
vote
2 answers

Displaying image name below the images in php

This is the code I am using for making a gallery type: Main PHP :
AnishDhoni
  • 37
  • 1
  • 7