directory-structure

Why does git store objects in directories with the first two characters of the hash?

混江龙づ霸主 提交于 2019-12-03 01:23:49
I'm designing a directory structure based on UUIDs so I'm looking at what git does to see if it would be a good model. I can see that git stores objects in a structure where the first two characters of the hash are used as a directory and the rest of the hash is the file name. What I'm wondering is why? If there's a big advantage to using the directories why aren't more subdirectories created... say a directory for each one or two characters in the hash creating a tree? If there isn't a big advantage then why the directory with the first two chars? Git switches from "loose objects" (in files

Data structure used for directory structure?

倖福魔咒の 提交于 2019-12-02 18:32:06
I'm making a program which the user build directories (not in windows, in my app) and in these folders there are subfolders and so on; every folder must contain either folders or documents. What is the best data structure to use? Notice that the user may select a subfolder and search for documents in it and in its subfolders. And I don't want to limit the folders or the subfolders levels. This is what I do: Every record in the database has two fields: ID and ParentID. IDs are 4-5 characters (Base36, a-z:0-9 or something similar). Parent IDs are a concatenation of the parent's complete

How to access files in subdirectories?

寵の児 提交于 2019-12-02 16:46:45
问题 I have several subdirectories beneath in a main directory, and each subdirectory contains one or two text files. I need to copy these text files to another directory. Here's how I coded. But it doesn't seem to work. What can I do? And is there a direct way of doing this? #!/usr/bin/perl use File::Copy; my $directorypath; opendir (DIR, '/d/work/abc') or die "cannot open path $!"; my @maindirectory = readdir (DIR); closedir (DIR); foreach my $subdirectorypath (@maindirectory) {

Maven naming conventions for hierarchical multiple module projects

余生长醉 提交于 2019-12-02 16:37:38
I've got a question on Maven naming conventions (groupId, artifactId and directory names) in a multiple module project with a hierarchical directory structrure. Research Before asking, I went through other the web on this topic and what I cleared out for myself: Possible duplication for my question, but it does not cover multiple-hierarchy levels. Project directory name should match artificatId . Guide to Naming Conventions provide examples: groupId will identify your project uniquely across all projects, so we need to enforce a naming schema. It has to follow the package name rules (eg. org

GWT Project Structure

亡梦爱人 提交于 2019-12-02 10:08:33
Right now in our project, we have below mentioned structure. Our project is mainly using GWT & Spring framework. com.customername.projectname.client.module name com.customername.projectname.client.rpc.module name com.customername.projectname.shared.validator.module name com.customername.projectname.server.module name com.customername.projectname.spring.dao.module name com.customername.projectname.spring.service.module name Our application.gwt.xml contains below entry for source which needs to be coverted in to java script. source path='client' source path='shared' As we are using spring at the

How to organize code so that we can move and update it without having to edit the location of the configuration file?

限于喜欢 提交于 2019-12-02 07:59:10
The issue that I consider is how to write code that can easily know the location of a required config file and yet is portable, without any edit, from an environment to another. We don't want to edit the location of the configuration file to adapt the code to each new environment, say each time we move the code from a development environment to production. The method should not rely on resources that are not universally available, such as an access to user-defined environment variables or an access to a specific directory. For example, it may seem that using the DOCUMENT_ROOT as a base

ASP.NET Session & Delete Folders

强颜欢笑 提交于 2019-12-02 06:37:39
问题 I have a web app where the administrator can create news, pdf documents and other stuff in his cms panel. The problem is when the admin delete a new or something else the app deletes all the files related to that new, I mean the images, pdfs and other documents. Tha main problem is those files are stored in folders under the "news" folder and when the app deletes them the session is lost. How can I do to have a file system without losing the session? I'd like that file system within the app

ASP.NET Session & Delete Folders

℡╲_俬逩灬. 提交于 2019-12-02 03:23:56
I have a web app where the administrator can create news, pdf documents and other stuff in his cms panel. The problem is when the admin delete a new or something else the app deletes all the files related to that new, I mean the images, pdfs and other documents. Tha main problem is those files are stored in folders under the "news" folder and when the app deletes them the session is lost. How can I do to have a file system without losing the session? I'd like that file system within the app folder... Impossible for us to store those folders outside the app and we don't want to use StateServer

Python: Check if a directory is an alias

。_饼干妹妹 提交于 2019-12-02 02:29:44
Does python have a simple function for checking if a directory is an actual directory or if it's just an alias to another directory? I'm trying to list all files/folders in a directory but because of these alias folders, I'm getting a lost of stuff that looks like this: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bundle/Home/bundle/Home/bundle/Home/bundle/Home/bundle/Home/bundle/Home/bundle/Home/bundle/Home/bundle/Home/bundle/Home/bundle I know I can write a function that will compare paths and quit if it seems like I'm going in circles, but is there a simple function that

How to create directories specified by a mapper in Ant

一个人想着一个人 提交于 2019-12-02 01:36:17
Given a fileset <fileset id="myFiles" dir="."> <include name="**/*.file"/> </fileset> How do I create a sub-directory at each file in the set, named after the filename without the extension? For example, given the files folderA/X.file and folderA/folderB/Y.file, I want to create the directories folderA/X and folderA/folderB/Y The ant touch task supports creating files, parent dirs and filename mapping, so can be used to achieve this: <target name="mkdirs"> <touch mkdirs="true"> <fileset dir="the_dir"/> <mapper type="glob" from="*.file" to="the_dir/*/.tmp" /> </touch> <delete> <fileset dir="the