w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Rails server command generates another folder in project's folder with default folders and files
This is because you are using rails 2 gem version, you can check by rails -v. As well you can see, there is no app/assets folder. there are only public/javascripts etc rails2 style directories Try to install rails 3 by gem install rails --version '>3.0.0'

Categories : Ruby On Rails

Copy folders and exclude folder
I'd suggest splitting the problem into 4 subs. Firstly two subs to allow users to select a folder they desire for source and destination. The a button click event that starts the copying and finally a sub that actually handles the copying. Try this on for size: Dim CopyFromPath As String Dim CopyToPath As String Private Sub TextBox1_MouseClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.MouseClick Dim fldbroser1 As New FolderBrowserDialog fldbroser1.RootFolder = Environment.SpecialFolder.MyMusic fldbroser1.ShowDialog() CopyFromPath = fldbroser1.SelectedPath End Sub Private Sub TextBox2_MouseClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.MouseClick Dim fldbroser1 As New FolderBrowserDialog f

Categories : Vb.Net

Items_ItemAdd listener for folder and it's sub folders in Outlook
You need to install the event sink on each folder's Items collection. To make sure all Items objects are alive while your app runs, store Items in a list (e.g. List<Outlook.Items>)

Categories : C#

delete all the folders inside a parent folder
Try this : function del($dir) { foreach(glob($dir . '/*') as $file) { if(is_dir($file)) del($file); } rmdir($dir); } It will also delete nested folders

Categories : PHP

How can I split a folder with thousands of images into multiple sub-folders?
awk one-liner can do that. Consider this awk command: find . -name "*.JPG" | awk '!(++cnt%100) {"mkdir sub_" ++d|getline}' Run it inside the folder with 5000 images. This will create 50 folders with the names sub_1, sub_2...sub_50. Also to move files into these newly created directories: find . -type f | awk '{ a[++cnt] = $0 } cnt==100 { subd = "sub_" ++d; system("mkdir " subd); for (f in a) system("mv " a[f] " " subd); cnt=0 }'

Categories : Osx

XCOPY files in batch to another folder but with structure of folders
Ah, finally found it. Putting an asterisk * behind the filename will do the trick. So, for any of you with the same problem: XCOPY "abcdef01.jpg" "D: ewphotosabcdef01.jpg*" This does the trick.

Categories : Misc

Randomly select 20 folders out of 50 in php, and then enumerate (thumbs) folder in each for thumbnails
First, save all galleries in an array. $storage = glob($galdir . '*', GLOB_ONLYDIR); Now, shuffle the array. shuffle($storage); You now have an array with all your galleries randomly sorted. Loop through them again. for($i = 0; $i < 20; $i++) { //Only 20 echo $storage[$i]; //Directory name. Add your HTML stuff here }

Categories : PHP

Batch Renaming Folders in AppleScript, Will Only Change Names of Every Other Folder
Jart, the main issue was with the second loop, you need to be looping through every folder of the x folder variable instead. It appears that looping through the folder worked, but when you renamed them it caused an index issue resulting in only reading every 2nd folder. Here is a little reworking. renamed your variables from y and x to be less cryptic. changed the length test to support names > 9. i was unsure about the item at the end of the new name, and if it should be an incremented number instead. (you can easily revert) left in some log calls for your reference, these can help debug stuff tell application "Finder" -- Defining Pro Folders set pro_folder to folder POSIX file "/Users/Jart/Desktop/test" set all_pro_folders to every folder of pro_folder -- Iter

Categories : Osx

Rename files within folders to folder names while retaining extensions
Here's something simple: find * -type f -maxdepth 1 | while read file do dirname="$(dirname "$file")" new_name="${dirname##*/}" file_ext=${file##*.} if [ -n "$file_ext" -a -n "$dirname" -a -n "$new_name" ] then echo "mv '$file' '$dirname/$new_name.$file_ext'" fi done The find * says to run find on all items in the current directory. The -type f says you only are interested in files, and -maxdepth 1 limits the depth of the search to the immediate directory. The ${file##*.} is using a pattern match. The ## says the largest left hand match to *. which is basically pulling everything off to the file extension. The file_dir="$(dirname "$file")" gets the directory name. Note quotes everywhere! You have to be careful about white spaces. By the way, I echo i

Categories : Bash

Create the same multiple folder in all sub directory folders from excel list using VBA
Use an array for the subfolders and loop through that for each of your 1st level folders. Change this line vSubfolders = Array("A", "B", "C") to add/remove your second level folders Sub MakeFolders() Dim xdir As String Dim fso As Object Dim lstrow As Long Dim i As Long Dim vSubfolders Dim vSubFolder vSubfolders = Array("A", "B", "C") Set fso = CreateObject("Scripting.FileSystemObject") lstrow = ActiveSheet.Cells(ActiveSheet.Rows.Count, "A").End(xlUp).Row Application.ScreenUpdating = False For i = 1 To lstrow xdir = "C:UsersNikkiSharedVIC" & Range("A" & i).Value If Not fso.FolderExists(xdir) Then fso.CreateFolder (xdir) End If For Each vSubFolder In vSubfolders If Not fso.FolderExists(xdir & "" & vSubFolder) Then fso.CreateFolder (xdir & "" & vSubFolder) End If Ne

Categories : Excel

How to recursively retrieve files from folders returning file name and its Folder name
You may want to use folderFullPath.lastIndexOf(File.separator) in order to find the index of the character before the folder name and then use substring to extract the folder name from the full-path.

Categories : Java

Run a batch file that would delete files in a folder (and its sub folders) that are older then 30 days
I did some copy and paste for you from here: forfiles -p "C:whatever" -s -m *.* /D -30 /C "cmd /c del @path" See forfile documentation for more details.

Categories : Windows

Hadoop HDFS Copy Files from multiple folders to one destination folder
There is DistCp which is an map-reduce job which copies files from one or multiple source folders to one target folder in an parallel manner. However, its not merging files. But maybe you could use filecrush to do that! (let me know how this goes!)

Categories : Hadoop

Batch Script to find Folder Length of 2 alpha-numerics only and delete thos folders
this will delete all empty folders with two characters or less: for /f %%i in ('dir /b /ad ??') do rd %%i If you want also not-empty folders to be deleted: for /f %%i in ('dir /b /ad ??') do rd %%i /s /q If you use it not within a batchfile but as a single command, replace every %%i with %i EDIT (exclude a folder): for /f %%i in ('dir /b /ad ??') do ( if "%%i" neq "FP" rd %%i /s /q )

Categories : Regex

Google Drive - Change owner on folder, sub-folders and content, while saving tree structure
Sorry this answer is late but I figure the answer would be helpful either way. 1) Apps Script doesn't have the ability to suppress the notification email but Google's most recent version of the Drive SDK does allow for this. You just need to append "?sendNotificationEmails=false" to the url that you're sending your request to. You can run a test on the linked page to see exactly what the query string looks like. 2) The folders actually do maintain their structure. There is just the consequence of a user getting ownership of each of those folders explicitly. Since the rights are given one folder at a time, the user gets access one folder at a time so they show up individually in the user's Drive documents. Still, a Drive file/folder's sharing is stored separately from its parent folder me

Categories : Google Apps Script

android hide folder to sd card and share the image inside the hidden folder
If you want to hide folder in Android or any Linux based system just add . as prefix to folder or file name. However if you mount your SD card on Windows machine then these folders will be visible, with the . in front of the folder name, as a normal folder.

Categories : Android

Using same drawable image in two different folder to support all tablets.(same image (no change)in two folders)
If you want to keep exactly the same image in drawable-large-xhdpi and drawable-xlarge-hdpi then you apparently do not really understand what these xhdpi and hdpi selectors stands for, as image cannot be hdpi and xhdpi at the same time, so your approach is basically wrong. Please read this article to get the picture of how Android manages assets: http://developer.android.com/guide/practices/screens_support.html EDIT Here another article that you need to read to understand how Android picks assets and how it falls back in case of lack of such: http://developer.android.com/guide/topics/resources/providing-resources.html#BestMatch that will help you organize your assets correctly

Categories : Android

Computing folder size: Empty folders have a default size?
Explorer shows both "Size" and "Size on disk". Since multiple files cannot share disk clusters, the minimum size a file will occupy on disk is one cluster (4096 bytes on your machine). Look at "Size" in Explorer.

Categories : Python

Move multiple files from multiple folders to one folder
How far have to got with this ? Have you managed to get them moving from one folder to another yet ? Is it an issue with the sub-folders ? I had a similar issue before and i found this answer really helped me : move files between folders

Categories : Windows

Batch: Create a list of folders and then copy multiple files/folders into all of them
Try this: @echo off &setlocal cd /d "RootFolder=X:folder omy data" for /d %%a in (*) do xcopy "_TEMPLATE" "%%~fa" /sihrky For xcopy options see xcopy /?, to test the command without writing add option /l.

Categories : List

How to stop threads of following type in Java used for watching folders for files using WatchService for folders by using jToggleButton
There is a Thread.stop() method, but is has been deprecated, because it's unsafe. Instead of using the deprecated method(s), you can modify some variable to indicate that the target thread should stop running.

Categories : Java

JQuery File Upload and Carrierwave to Detect Folders and Sub Folders
I don't think this is possible. See here: http://www.codeproject.com/Questions/573788/HoeplustoplusGetplustheplusOriginalplusfilepluspat It appears that you can't know the context of the uploaded file on the source operating system. Therefore you can't create it's original parent folder structure on your system.

Categories : Jquery

Batch file creating folders in all folders of current directory
Total rewrite of answer. This will make a "Outlook Archive" folder in only the DataMy Documents subfolders of wherever the batch file resides. for /f "delims=" %%i in ('dir /ad/s/b') do if EXIST "%%iDataMy Documents" MKDIR "%%iDataMy DocumentsOutlook Archive" pause Credit to here

Categories : Windows

MATLAB: Opening and Editing Files nested in folders in folders
Check out subdir! On the file exchange, its an awesome function that can return all folders and all files in expansive subfolders, and you can filter file names by extension and whatnot. http://www.mathworks.com/matlabcentral/fileexchange/15859-subdir-a-recursive-file-search

Categories : Matlab

Android Not Respecting my res folders
Personaly I would use Screen pixel density (dpi) for each layout. That is: ldpi: Low-density screens; approximately 120dpi. mdpi: Medium-density (on traditional HVGA) screens; approximately 160dpi. hdpi: High-density screens; approximately 240dpi. xhdpi: Extra high-density screens; approximately 320dpi. Added in API Level 8 See http://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources

Categories : Android

Android screen sizes - containing folders
You can specify that in youar Manifest file saying which screen sizes your appshould support. something like this <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" />

Categories : Android

Android project folders in eclipse
Android dependencies Android Dependencies is a virtual folder where Eclipse shows what JAR files the project depends on. Android private library Contains android-support-v4.jar needed to support classes like Fragments in earlier APIs. libs Any of your personal jar file goes here.

Categories : Android

Red Sign over drawable folders Android
There is probably a lint warning, something like "you have drawables that are identical in different dpi folders". Change your lint settings, or fix whatever the warning is. In Eclipse, you can narrow down on the errors/warnings by selecting the folder in question, and setting Show > Errors/Warnings on Selection

Categories : Android

How to use cp to copy only certain sub-folders? [ Android - root ]
In the end I used a script to handle this (I don't think there's a one-line command to do it) So basically I created this sh <!-- language: lang-sh --> #!/bin/sh DATA=/data/data TEMP=/data/ztemp; if [ ! -e ${TEMP} ] then mkdir ${TEMP} fi for f in ${DATA}/*; do PACKAGE="$(basename "$f")" if [ -e ${DATA}/${PACKAGE}/shared_prefs ] then if [ ! -e ${TEMP}/${PACKAGE} ] then mkdir ${TEMP}/${PACKAGE} fi cp -r ${DATA}/${PACKAGE}/shared_prefs/* ${TEMP}/${PACKAGE} fi done echo Finished! copied inside the device private static void copyScript(Context context) { FileOutputStream fos; try { InputStream is = context.getAssets().open(SCRIPT);

Categories : Android

creating different folders each time android app is used
you will get all your answers on this previous post: How to create directory automatically on SD card the key to achieve it is the method: mkdirs(); and don't forget to give your device the necessary permission within the Android.xml! <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Categories : Android

How to check whether a folder having sub folder in android?
Try this, ..... List<File> files = getListFiles(new File("YOUR ROOT")); .... private List<File> getListFiles(File parentDir) { ArrayList<File> inFiles = new ArrayList<File>(); File[] files = parentDir.listFiles(); for (File file : files) { if (file.isDirectory()) { inFiles.addAll(getListFiles(file)); } else { if(file.getName().endsWith(".csv")){ inFiles.add(file); } } } return inFiles; }

Categories : Android

check if some folders exists java Android
Is this enough? Path uploadPath = Paths.get(uploadFilePath); Path path = Files.exists(uploadPath) ? uploadPath : Files.createDirectory(uploadPath); System.out.println(path); Then to check for the N directories, put it in a loop maybe. final String[] paths = { "C:/aa/", "C:/bb/", "C:/cc/", "C:/dd/"}; for (String path : paths) { Path uploadPath = Paths.get(path); if(Files.exists(uploadPath)) Files.createDirectory(uploadPath); System.out.println(uploadPath); }

Categories : Java

On one android handset, it is taking image from different folders
Just try this once.. place 320 X 480 images in drawable-mdpi, place 480 X 800 images in drawable-hdpi, place 720 X 1280 images in drawable-xlarge-v11. Once check with name conflict of images also. Use same image names in all folders.

Categories : Android

Delete all folders except 2 lastest folders in Windows
for /f "skip=2 delims=" %G in ('dir /B /ad-h /o-d') DO echo going to delete %G For /f to process lines of "output" from single-quoted DIR... Delims= is better. tokens=* will work here, but suppresses leading spaces. /b to suppress header output from dir /o-d for REVERSE-date order. You want to KEEP the two skipped dirs, which occur FIRS in a reverse-date sort. ...good echo safety measure.

Categories : Windows

Android resourse folders swXXXdp for 5 inch phones
S3: DPI: 306 RES: 1280x720 Screen: 4.8" 720 / (306/160) = 720 / 1.9125 = 376.47 dp S4: DPI: 441 RES: 1920x1080 Screen: 5.0" 1080 / (441/160) = 1080 / 2.75625 = 391.8367 dp So basically there is a very small difference between S3 and S4. But if you want to distinguish layouts for these devices, use sw376dp for S3 and sw390dp for S4. But make a note that other 5" phones could be different.

Categories : Android

How can I display the folders that require root acess in android?
You cannot do this without rooting the device (which simply means gaining required root access level). That's basically the reason for permission system - to keep you away from the places you should not be looking in.

Categories : Android

How to pick the files from folders and subfolders in Android iteratively?
Add a separate method to your activity that does the following: private ArrayList<SongDetails> getSongsFromDirectory(File f){ ArrayList<SongDetails> songs = new ArrayList<SongDetails>(); if (!f.exists() || !f.isDirectory()) return songs; File[] files = f.listFiles(new Mp3Filter()); for (File file : files){ if (file.isDirectory()){ songs.addAll(getSongsFromDirectory(file)); } else{ SongDetails detail=new SongDetails(); detail.setIcon(R.drawable.ic_launcher); String fileName = file.getName(); detail.setSong(fileName); detail.setArtist(fileName); detail.setAlbum(fileName); songs.add(detail); } } return songs; } Also change your filter to a

Categories : Android

How to prepare layout,drawable folders for 7",10" android tablets for both landscape and portrait?
You are naming the folders in the wrong way. In Android, there is a rule or order in which you name your resource folders. You should provide your qualifier names in that order. Check this documentation table on providing resources. Your should name your folders in the order provided in the table.(Its better if you read the whole page, because it'll give you a better understanding in providing resources) Here you should name the folders as layout-large-port-hdpi drawable-large-port-hdpi For preparing the resource folders for tablets, you can use either the screen size attribute or shortest width attribute. For e.g If you use screen size attribute, you can name folders like layout-large-... (for 7" devices) layout-xlarge-... (for 10" devices) I you use shortest width attribute, y

Categories : Android

How to include "Android" folder to Android Studio (ZXing)
I fallowed this tutorial: http://phpmyweb.net/2012/07/18/integrating-zxing-in-your-android-app-as-standalone-scanner/ which worked fine for me

Categories : Android

Moving files from one folder to a hot folder BUT only move one at a time when the hot folder is empty
Pretty sure this should do what you want in vbscript: Set objFS = CreateObject("Scripting.FileSystemObject") set objFolderA = objFS.GetFolder("c:Folder A") set objFolderB = objFS.GetFolder("c:Folder B") For each objFile in objFolderA.Files Do While True If objFolderB.Files.Count = 0 Then objFS.MoveFile objFile.Path, ojbFolderB.Path & "" Exit Do End If Loop Next

Categories : Batch File



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.