directory

Create CSV file in Swift and write to file

不羁岁月 提交于 2019-12-12 09:17:27
问题 I have an app I've made that has a UITableView with todoItems as an array for it. It works flawlessly and I have an export button that creates a CSV file from the UITableView data and emails it out: // Variables var toDoItems:[String] = [] var convertMutable: NSMutableString! var incomingString: String = "" var datastring: NSString! // Mail alert if user does not have email setup on device func showSendMailErrorAlert() { let sendMailErrorAlert = UIAlertView(title: "Could Not Send Email",

Recursively scan directory and sub-directories through FTP with PHP

纵饮孤独 提交于 2019-12-12 09:06:16
问题 I'm trying create a list of all files (and their sizes) in a directory including everything within the sub-directories. The files are on a remote server. So my script connects through FTP, then runs a recursive function using ftp_chdir to go through each directory. If there's another way to do this, I'm open to suggestions. $flist = array(); function recursive_list_dir($conn_id, $dir, $parent = "false") { global $flist; ftp_chdir($conn_id, $dir) or die("Fudgeballs: ".$parent."/".$dir); $list

differences between /sdcard/emulated/0 and /sdcard

人盡茶涼 提交于 2019-12-12 08:21:40
问题 I'm goig to be mad with a strange issue. If i create a folder inside my code as directory_path = Environment.getExternalStorageDirectory() + "/" + context.getResources().getString(R.string.app_name); directory = new File(directory_path); if (!directory.exists()) { directory.mkdirs(); } a new folder is created inside /sdcard/ . If i try to print on logcat directory_path variable, the path is different: /storage/emulated/0/ and if i go to that path, i found another folder with the same name of

jpegtran whole directory

左心房为你撑大大i 提交于 2019-12-12 08:04:42
问题 I want to optimize the whole test folder with jpg images from a command line. I found this but it doesn't work: cd /home/site/html/update/test/ find . -exec jpegtran -optimize "{}" "{}.opti.jpg" "{}" \; I want to overwrite the existing images. Suggestions? Answer: find /img/path -name "*.jpg" -type f -exec jpegtran -copy none -optimize -outfile {} {} \; 回答1: Answer: find /img/path -name "*.jpg" -type f -exec jpegtran -copy none -optimize -outfile {} {} \; 来源: https://stackoverflow.com

Best directory structure for static files: hierarchical vs. flat

左心房为你撑大大i 提交于 2019-12-12 06:48:16
问题 To be clear, I'm not looking for opinions but rather facts based on actual in-the-field usage of different file structure types. In researching, before asking this questions, I've seen many posts about what the right folder structure is for a web application. For example, I'll see someone list where the following should go: css, js, html, images, php. But, I haven't seen anyone go into much deptch about what the static directory structure should look like. I have a lot of images in form of

List local directory on Web Application

帅比萌擦擦* 提交于 2019-12-12 06:26:40
问题 I have an idea a Web Application and I would need to list all files of a directory that exists on the client machine (For example C:\Temp). I searched a lot on the Internet and as well on Stack Overflow. I couldn't find an answer on any questions that soved my problems. I want to be able to list all files and subdirectories of a directory and if possible get the file type. I know that this isn't able to do only with native Javascript. If there is something restricted to a browser like Firefox

how to batch move files date filename folder?

随声附和 提交于 2019-12-12 06:12:52
问题 I have lots of image files named as YYYYMMDD_HHmm.jpg How can I move these files to: target_directory\YYYY\MM\YYYYMMDD_HHmm.jpg ? Thank you 回答1: You can use a for loop, substrings, and mkdir : @echo off setlocal enabledelayedexpansion for /f %%a in ('dir /b /a-d') do ( set filename=%%a ::exclude this file if not "!filename!" == "%~nx0" ( ::substr to grab characters 0-4 and 4-6 as year and month set year=!filename:~0,4! set month=!filename:~4,2! ::make dirs for the files if they don't already

Folder1 and Folder2 logs not showing correctly in Batch files

戏子无情 提交于 2019-12-12 05:59:54
问题 This should be simple but is not working correctly. FOR /D %%d IN ("D:\Folder*") DO ( FOR /R "%%d\logs" %%i IN (*) do echo %%i ) pause I have also tried: FOR /D %%d IN ("D:\Folder*") DO ( SET fld=%%d FOR /R "%fld%\logs" %%i IN (*) do echo %%i ) pause I feel that am missing something pretty basic. Thanks! 回答1: First code FOR /D %%d IN ("D:\Folder*") DO ( FOR /R "%%d\logs" %%i IN (*) do echo %%i ) fails because you can not use a for replaceable parameter in the folder of a for /r . In the way

JavaFX - `isDirectory` Not Returning TRUE

十年热恋 提交于 2019-12-12 05:28:56
问题 Why is this check not return true? String dirpath = getClass().getResource("../util/assets/sounds/").toString(); File dir = new File(dirpath); System.out.println(dirpath); System.out.println(dir); System.out.println(dir.isDirectory()); It returns these: file:/D:/JAVA/exercises/FX/TasksList/build/classes/taskslist/util/assets/sounds file:\D:\JAVA\exercises\FX\TasksList\build\classes\taskslist\util\assets\sounds false I run it using netbeans IDE as a source code. 回答1: getClass().getResource(...

Getting R to store the working directory for every session

我是研究僧i 提交于 2019-12-12 05:28:38
问题 I asked this on Super User, but someone suggested that I take it here because there are many more R experts. The question: I have to keep navigating to my directory when I go to File > Change dir..., which is particularly annoying. Does anyone know how to make R remember the previously used directory? 回答1: I keep all the code associated with a particular project in a file (or more often a series of files). The first line is usually setwd(...) which sets the directory. Once a workspace has