directory

PHP array of folders in directory and show files in each folder

爱⌒轻易说出口 提交于 2019-12-12 05:04:16
问题 I am using the following code to list all folders in a directory (called test), and all files within those folders: <?php function listFolderFiles($dir){ $ffs = scandir($dir); echo '<ol>'; foreach($ffs as $ff){ if($ff != '.' && $ff != '..'){ echo '<li class="title">'.$ff; if(is_dir($dir.'/'.$ff)) listFolderFiles($dir.'/'.$ff); echo '</li>'; } } echo '</ol>'; } listFolderFiles('test'); ?> This works fine, however I want to be able to link to each file in those folders. Can anyone tell me how I

Why my decompress class don't make directories?

眉间皱痕 提交于 2019-12-12 05:02:08
问题 I have a class to decompress files, it works fine when the zip doesn't have any folder inside. If it does then it just throw errors. Hers my class: public class Decompress { private String _zipFile; private String _location; ZipEntry ze = null; public Decompress(String zipFile, String location) { _zipFile = zipFile; _location = location; _dirChecker(""); } public void unzip() { try { FileInputStream fin = new FileInputStream(_zipFile); ZipInputStream zin = new ZipInputStream(fin); while ((ze

Extracting text from a file where date -time is the index

夙愿已清 提交于 2019-12-12 04:42:30
问题 I have got around 800 files of maximum 55KB-100KB each where the data is in this format Date,Time,Float1,Float2,Float3,Float4,Integer Date is in DD/MM/YYYY format and Time is in the format of HH:MM Here the date ranges from say 1st May to 1June and each day, the Time varies from 09:00 to 15:30. I want to run a program so that, for each file, it extracts the data pertaining to a particular given date and writes to a file. I am trying to get around, to form a to do a search and extract

sharing a folders permission in C#

↘锁芯ラ 提交于 2019-12-12 04:38:59
问题 I am trying to create a tools help the users to control the shared folders, anyway i have a problems with the permissions in the share folder i made everything good but when testing the permissions is not executing This is command to create a share folder exist: // use CMD to sharing the folder System.Diagnostics.Process command = new System.Diagnostics.Process(); command.StartInfo.CreateNoWindow = true; command.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; command

ContactsContract.Directory - How do I return a Photo?

江枫思渺然 提交于 2019-12-12 04:37:44
问题 I am trying to figure out why I can't seem to pass a photo Uri (Uri.parse(http://url/image.png)) to the contacts app via ContactsContract.Directory I have a web service which allows searching of an address book. One of the returned fields is a url of the contact which resides on a webserver which I have verified is accessible from my Honeycomb Tablet. My ContactsContract.Directory seems to be working flawlessly returning results, but when I pass back as part of the FILTER query Contacts.PHOTO

Use akka actors to traverse directory tree

ε祈祈猫儿з 提交于 2019-12-12 04:34:31
问题 I'm new to the actor model and was trying to write a simple example. I want to traverse a directory tree using Scala and Akka. The program should find all files and perform an arbitrary (but fast) operation on each file. I wanted to check how can I model recursion using actors? How do I gracefully stop the actor system when the traversal will be finished? How can I control the number of actors to protect against out of memory? Is there a way to keep the mailboxes of the actors from growing

Zip4j Excluding Folders from Zip

无人久伴 提交于 2019-12-12 04:23:50
问题 I have a directory with some folders that should be skipped and not added to the target ZIP file. I marked them as hidden on Windows and I can query this attribute using Java code as follows: new File("C:\\myHiddenFolder").isHidden(); However, I don't know how to use this with the following Zip4j-based method to skip adding those respective directories: public File createZipArchive(String sourceFilePath) throws ZipException, IOException { ZipParameters zipParameters = new ZipParameters();

Search for specific lines from a file

落爺英雄遲暮 提交于 2019-12-12 04:22:07
问题 I have an array that contains the data from a text file. I want to filter the array and copy some information to another array. grep seems to not work. Here's what I have $file = 'files.txt'; open (FH, "< $file") or die "Can't open $file for read: $!"; @lines = <FH>; close FH or die "Cannot close $file: $!"; chomp(@lines); foreach $y (@lines){ if ( $y =~ /(?:[^\\]*\\|^)[^\\]*$/g ) { print $1, pos $y, "\n"; } } files.txt public_html Trainings and Events General Office\Resources General Office

How to get the current directory for an nw.js executable

佐手、 提交于 2019-12-12 04:21:57
问题 Struggling to find the current directory when I create an nw.js executable. I have created a Mac server application with a mix of html and Javascript and a lot of node.js module usage. I have two xml files that the server accesses and that reside in the same folder as the application. When I run the application as follows: ./nwjs.app/Contents/MacOS/nwjs . and find the current directory as follows: var workingFolder = process.cwd(); then my working folder is the one where the application and

Watch a Directory and Process Copied Files -Check for Copy Completion and Open Handles

不想你离开。 提交于 2019-12-12 04:18:45
问题 I need to watch a directory for image files(jpeg,png,tif,gif,bmp) and process new files placed there.Im trying to implement this using FileSystemWatcher private void watch() { FileSystemWatcher watcher = new FileSystemWatcher(); watcher.Path = path; watcher.Filter = "*.*"; watcher.Changed += new FileSystemEventHandler(OnChanged); watcher.EnableRaisingEvents = true; } But how can i make sure that the file is copied in full and there is no handle locking the file before trying to open it? 回答1: