directory

Python: Get a list of all files and folders in a directory, the time of creation, the time of last modification. System independent solution?

∥☆過路亽.° 提交于 2019-12-21 11:02:10
问题 This is a challenge as well as a question: I have a folder of data files. I want the following list of lists of information: Filename: Created: Last modified: Information = [ [datafile1, Mon Mar 04 10:45:24 2013, Tue Mar 05 12:05:09 2013], [datafile2, Mon Mar 04 11:23:02 2013, Tue Apr 09 10:57:55 2013], [datafile2.1, Mon Mar 04 11:37:21 2013, Tue Apr 02 15:35:58 2013], [datafile3, Mon Mar 04 15:36:13 2013, Thu Apr 18 15:03:25 2013], [datafile4, Mon Mar 11 09:20:08 2013, Mon May 13 16:30:59

Android: path of assets folder for File()?

こ雲淡風輕ζ 提交于 2019-12-21 09:34:45
问题 I have some files in the assets folder of my project, and I want to list them, so I put this in my code: File dir = new File("com.packagename/assets/fonts"); File[] fileList = dir.listFiles(); Which path should I put to make it work? I want it so users could install new fonts (I don`t know how to do this yet) so I need to list all the fonts in the folder, including post-installed fonts. If there is any other solutions, please share. 回答1: Assets and resources are accessible using file://

Android: path of assets folder for File()?

安稳与你 提交于 2019-12-21 09:34:24
问题 I have some files in the assets folder of my project, and I want to list them, so I put this in my code: File dir = new File("com.packagename/assets/fonts"); File[] fileList = dir.listFiles(); Which path should I put to make it work? I want it so users could install new fonts (I don`t know how to do this yet) so I need to list all the fonts in the folder, including post-installed fonts. If there is any other solutions, please share. 回答1: Assets and resources are accessible using file://

iPhone SDK: subFolders inside the main bundle

扶醉桌前 提交于 2019-12-21 07:57:20
问题 in the current project I have a number of folders, with subfolders, and these contain images: 01.png, 02.png. Folder1/FolderA/f1.png Folder1/FolderB/F1.png When I compile the app, I looked inside the the .app and noticed that all the images are placed in the top level, with no sub-folders. So clearly when trying to load the image this doesn't work: NSString *filePath = [[NSBundle mainBundle] pathForResource:@"f1" ofType:@"png" inDirectory:@"Folder1/FolderA"]; But even more strangely, when

Gradle: how do I configure the jar location to be in the parent directory of the project?

谁说胖子不能爱 提交于 2019-12-21 07:55:53
问题 I'm trying to build a Gradle JAR project that is a subproject of another and would like the output JAR file to be in a parent directory (to be specific in the "lib" directory of the parent, or sibling). How do I configure Gradle for this and where is this documented? 回答1: In build.gradle , add: libsDirName = '../../lib' The config settings are shown in the official Gradle docs for the java plugin. BTW, I fully agree with the intent behind the comments and answers given by Peter and Hiery, but

Add more than one resource directory to jetty

会有一股神秘感。 提交于 2019-12-21 07:45:59
问题 Looking to use multiple static directories with Jetty. When the server runs: http://localhost:8282/A http://localhost:8282/B http://localhost:8282/C A is placed in X/V/A B is placed in Q/Z/B C is placed in P/T/C The following failed: ResourceHandler resource_handler = new ResourceHandler(); resource_handler.setWelcomeFiles(new String[]{"index.html"}); resource_handler.setResourceBase(HTML_SITE); ResourceHandler resource_handler1 = new ResourceHandler(); resource_handler1.setWelcomeFiles(new

MATLAB - read files from directory?

空扰寡人 提交于 2019-12-21 07:19:28
问题 I wish to read files from a directory and iteratively perform an operation on each file. This operation does not require altering the file. I understand that I should use a for loop for this. Thus far I have tried: FILES = ls('path\to\folder'); for i = 1:size(FILES, 1); STRU = pdbread(FILES{i}); end The error returned here suggests to me, a novice, that listing a directory with ls() does not assign the contents to a data structure. Secondly I tried creating a file containing on each line a

How can you tell if an object is a folder on AWS S3

冷暖自知 提交于 2019-12-21 07:12:11
问题 I doesn't appear in the meta data--whether an object is a folder or not. Is there a specific method you guys on SO know of? I can't find anything of worth in Google search. 回答1: I don´t know if this response it will be usefull after so long, but here we go: To resolve this problem you have to do this in java: List<S3ObjectSummary> files = s3client.listObjects(bucket.getName()).getObjectSummaries(); for (S3ObjectSummary file : files) { if (file.getKey().endsWith("/")) System.out.println("----"

php relative paths and directories

我是研究僧i 提交于 2019-12-21 05:56:16
问题 I'm wondering something, but I can't seem to be finding a good, clear answer, or even a solution to this problem: My PHP website has the following structure: root functions generators helpers scripts style index.php These are all folders and one php file. Functions contains a bunch op php files related to database connection and various other database operations such as inserting, deleting, updating,... Generators contains classes to automatically generate web pages to make them look all the

htaccess block access to directory but allow access to files

与世无争的帅哥 提交于 2019-12-21 05:07:32
问题 I have such situation. I'm developing application in Zend Framework and htaccess pointing every request to index.php. If some file or directory exists on the request path then htaccess allow access to this files like css, js, images etc... Now I have for example such link: example.com/profile/martin-slicker-i231 With Zend Router it points to controller account and action viewprofile. I want to add some avatart for my users and I created directory in public folder (so the images would be