directory-listing

Get directory structure from FTP using PHP

偶尔善良 提交于 2021-02-08 09:20:08
问题 I have ftp server with a lot of subfolders and files in it. I need to retrieve the folder structure from ftp, which shows names of all folders and subfolders from a specified starting path. I'm not interested in files included in each folder, only the directory tree. I'm using PHP and my server does not support mlsd. Thanks for help. I implemented my own recursive function, which for some reason is not working. function ftp_list_files_recursive($ftp_stream, $path) { $lines = ftp_rawlist($ftp

How do you recursively get a list of all folder names in a directory in Node.js? [closed]

不想你离开。 提交于 2020-05-22 09:57:50
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 7 days ago . I'm trying to get a list of all the folders present in a directory recursively. I then want to get a list of all the folders in each of those folders. I want to continue to do this recursively. How can I do this? const folder = 'folder1/'; const fs = require('fs'); fs.readdir

How do you recursively get a list of all folder names in a directory in Node.js? [closed]

感情迁移 提交于 2020-05-22 09:57:18
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 7 days ago . I'm trying to get a list of all the folders present in a directory recursively. I then want to get a list of all the folders in each of those folders. I want to continue to do this recursively. How can I do this? const folder = 'folder1/'; const fs = require('fs'); fs.readdir

How to call a powershell script from a C code

倾然丶 夕夏残阳落幕 提交于 2020-01-23 03:35:23
问题 In my case, I needed to call a powershell script from a c or c++ code source, found few links which were pretty clumsy and not good with c++, I simply want a roadmap if its possible invoking a powershell script which lists directory contents from a code snippet written in c or c++ 回答1: C++ code : #include<iostream> #include <io.h> // For access(). #include <sys/types.h> // For stat(). #include <sys/stat.h> // For stat(). #include <string> using namespace std; void main() { string strPath = "d

Exclude folders from recursion in recursive directory iterator php

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-05 07:15:18
问题 I need to exclude all files and folders from a certain directories while doing the recursion. I have this code so far : $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($websiteRoot.$file["filepathfromroot"])); foreach ($it as $currentfile) { if (!$it->isDot()&&$it->isFile()&&!in_array($it->getSubPath(), $file["exclude-directories"])) { //do something } } However this subpath will only match for children and and not files and sub directories off the children. i.e For a

Recursive directory listing in DOS

删除回忆录丶 提交于 2019-12-29 02:24:06
问题 How do we achieve a 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. 回答1: You can use: dir /s If you need the list without all the header/footer information try this: dir /s /b (For sure this will work for DOS 6 and later; might have worked prior to that, but I can't recall.) 回答2: dir /s /b /a:d>output.txt will port it to a text file 回答3: You can get the parameters you are

how to iterate over non-English file names in PHP

筅森魡賤 提交于 2019-12-25 02:18:10
问题 I have a directory which contains several files, many of which has non-english name. I am using PHP in Windows 7. I want to list the filename and their content using PHP. Currently I am using DirectoryIterator and file_get_contents . This works for English files names but not for non-English (chinese) file names. For example, I have filenames like "एक और प्रोब्लेम.eml", "hello 鶨鶖鵨鶣鎹鎣.eml". DirectoryIterator is not able to get the filename using ->getFilename() file_get_contents is also not

Directory.GetFiles() pattern match in C#

拜拜、爱过 提交于 2019-12-22 06:48:28
问题 I'm using Directory.GetFiles() to list files according to given pattern. This works fine for most of patterns I'm looking for (e.g. zip, rar, sfv). This is how I prepare the list (more or less). The problem is with pattern of numbers .001 to .999 that I want to list. alArrayPatternText.Add("*.zip"); alArrayPatternText.Add("*.sfv"); alArrayPatternText.Add("*.r??"); alArrayPatternText.Add("*.001"); for (int i = 2; i <= 999; i++) { string findNumber = String.Format("{0:000}", i);

How to disable or reprioritize IIS DirectoryListingModule under MVC module?

余生颓废 提交于 2019-12-18 06:18:30
问题 I use an MVC folder structure where the URL routes happen to match the directory names, eg.: <proj>\My\Cool\Thing\ThingController.cs Needs to be accessible by this url: http://blahblah/My/Cool/Thing I have the MVC routing working but unfortunately when relying on default {action} & {id}, IIS Express is routing the request to DirectoryListingModule instead, since it directly matches a folder name. Directory listing is disabled of course so instead I get: The Web server is configured to not

How to order files by last modified time in ruby?

情到浓时终转凉″ 提交于 2019-12-17 22:57:57
问题 How to get files in last modified time order in ruby? I was able to smash my keyboard enough to achieve this: file_info = Hash[*Dir.glob("*").collect {|file| [file, File.ctime(file)]}.flatten] sorted_file_info = file_info.sort_by { |k,v| v} sorted_files = sorted_file_info.collect { |file, created_at| file } But I wonder if there is more sophisticated way to do this? 回答1: How about simply: # If you want 'modified time', oldest first files_sorted_by_time = Dir['*'].sort_by{ |f| File.mtime(f) }