w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Java download all files and folders in a directory
Have you considered tool like HTTrack, it can detect presence of anchor tag on HTML and download entire website (limited by tree level). You can also specify filter what files should be downloaded etc If this doesn't suit your requirement, you can still use hand written Java program, except the problem is obtaining a list of files in the URL (and all subfolder within). You need to parse the HTML, gather all the anchor tags, and traverse it (which is what HTTrack is doing)

Categories : Java

UNIX: How to change all hidden folders/files to visible in a directory
I am not sure why you would want to do this but you could do the following three commands ls | grep "^." | sed -e "s/.(.*)$/mv 1/" > mv_hidden . mv_hidden rm mv_hidden You might want to check that the list of command produce in the file mv_hidden looks correct.

Categories : Unix

Delphi function, Not allowing files and folders from main directory during compression
The code already employs a technique for skipping certain unwanted file names: if (sr.Name <> '.') and (sr.Name <> '..') then Simply use that same technique to exclude whatever other files you wish. You can hard-code the exclusion list into the code, as is already done with the . and .. names, or you can pass a list of names into the function as another parameter. Before you add a file to the archive, check whether that file name is in the list of files to exclude. For example, if the list of excluded names were in a TStrings descendant, you might use something like this: if ExcludedNames.IndexOf(sr.Name) >= 0 then Continue; // Skip the file because we've been told to exclude it. You could enhance this to check the full path of the file instead of just the local nam

Categories : Delphi

How can i get a list of files(only sound related .flac, .m4b, .mp3) and folders with them from a directory on the sd card?
static Uri[] mUris; static String[] mFiles = null; public static String[] getMusic(){ File music = Environment.getExternalStorageDirectory(); // File asd = Environment. // String[] savedFiles = getApplicationContext().fileList(); File[] musicList = music.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { // TODO Auto-generated method stub return ((name.endsWith(".mp3")||(name.endsWith(".m4b")||(name.endsWith(".flac")))); } }); mFiles = new String[musicList.length]; for(int i=0; i<musicList.length;i++) { mFiles[i]=musicList[i].getAbsolutePath(); } return mFiles;

Categories : Android

scandir to only show folders, not files
Function is_dir() is the solution : foreach ($files as $file) { if(is_dir($file) and $file != "." && $file != "..") $filelist .= sprintf('<option value="%s">%s</option>' . PHP_EOL, $file, $file ); }

Categories : PHP

Copy-item Files in Folders and subfolders in the same directory structure of source server using Powershell
This can be done just using Copy-Item. No need to use Get-Childitem. I think you are just overthinking it. Copy-Item -Path C:MyFolder -Destination \ServerMyFolder -recurse -Force I just tested it and it worked for me.

Categories : Powershell

Show every file in a directory, but don't show files that are currently being copied
There's no "current files being copied" list stored anywhere in Windows/.NET/whatever. Probably the most you could do is attempt to open each file for append and see if you get an exception. Depending on the size and location of your directory, and on the security setup, that may not be an option.

Categories : C#

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

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

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

Adding desktop path to powershell to switch between folders easily?
You should create an alias. Set-Alias alias command example Set-Alias "folder" "cd C:/Path/to/desktop/folder" Edit: if you want to use argument you should make a script (using or not an alias to call it)

Categories : Powershell

Using batch files to copy all files from a directory tree to a single directory
@echo off set "COPY_FROM=C:UsersmeDesktopDisc 1" set "COPY_TO=C:Testing est" md "%copy_to%" 2>nul cd /d "%COPY_FROM%" for /f "delims=" %%a in ('dir /b /s /a-d') do copy "%%a" "%COPY_TO%" pause

Categories : Batch File

Gallery Is Missing Files From Directory- How To Retrieve All Files From Directory
An alternative approach you may want to use to secure your list of thumbnails: $directory = 'thumb'; //where the gallery thumbnail images are located $files = glob($directory."/*.{jpg,jpeg,gif,png}", GLOB_BRACE); natsort($files); //sort by filename Then to render it out simply do this: <?php for($x = 0; $x < count($files); $x++): $thumb = $files[$x]; $file = basename($thumb); $nomargin = $x%4 == 0?" nomargin":""; $title = htmlspecialchars($file); ?> <div class="thumbs fancybox<?= $nomargin ?>" style="background:url('<?= $thumb ?>') no-repeat 50% 50%;"> <a rel="group" href="images/'.<?= $file ?>" title="<?= $title ?>"><?= $title ?></a> </div> <?php endfor;

Categories : PHP

How can I copy folders to a directory?
Judging by the error message you are throwing the path does not exist. To copy an entire directory use the following: string sourcePath = @"C:UsersPublicTestFolder"; string targetPath = @"C:UsersPublicTestFolderSubDir"; if (System.IO.Directory.Exists(sourcePath)) { string[] files = System.IO.Directory.GetFiles(sourcePath); // Copy the files and overwrite destination files if they already exist. foreach (string s in files) { // Use static Path methods to extract only the file name from the path. fileName = System.IO.Path.GetFileName(s); destFile = System.IO.Path.Combine(targetPath, fileName); System.IO.File.Copy(s, destFile, true); } } else { Console.WriteLine("Source path does not exist!"); } See this MSDN page for more informatio

Categories : C#

Indexing folders: Not detecting a directory
scandir returns filenames, not pathnames, so you need to add the directory prefix: foreach(scandir('files'. $dir) as $filename){ if($filename == ".." || $filename == "."){ // do nothing. We want files and folders, not dots. } else { if(is_file($filename)){ echo '<a href="files/'. $dir . '/' . $filename .'">'. $filename .'</a><br>'; } else { echo '<a href="files.php?dir=' . $dir . '/' . $filename .'">'. $filename .' (dir)</a><br>'; } } } You were also missing files.php? in the first link, and the second link should use dir= to make it recurse into the subdirectory.

Categories : PHP

C Recursive Directory copy of sub folders
It looks like it's failing to insert the directory separator character (/) between the base directory and the appended part. Assuming name = "/home/foo/bar", EndPtr will point at the '' at the end, and then e->d_name is copied there, without anything in-between. This is wrong, it will create a mashed-up filename.

Categories : C

Mapping two workspace folders to the same working directory
As far as I know, it is not possible to map two different TFS folders to the same local filesystem path, or to overlapping filesystem paths - regardless of whether the two mappings are in the same workspace, or in two different workspaces. Since workspaces and their mappings are managed and stored on the TFS server, the server is capable of enforcing this restriction across all workspaces - even if the workspaces belong to different users. The important thing that the server checks for is the hostname of the client system that the workspace belongs to. All this information comes from personal observation. There may be official documentation that confirms my observations, but I have not checked. To answer your question: You might be able to pull this off if you can manipulate the build w

Categories : Visual Studio 2010

Create folders in directory from values in list. Python
to make a folder: import os os.mkdir(path[, mode]) if you want to make a directory such as ~/dinosaur/llama/nested/etc/ then you should use os.makedirs(path[, mode]) as it builds all the nested paths needed to make sure that is valid so say you're currently in ~/tmp >>> import os >>> os.mkdir('llama') >>> os.mkdir('me') to make the folders inside that directory. but what if we wanted inside ~/llama/me/ but we're still in ~/tmp~? then you can use mkdir twice, or you can just use >>> import os >>> os.makedirs('/home/llama/me')

Categories : Python

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

Access SQLite3 database that is located up one directory from application folders
Add a configuration.py module to your MainApp package with: import os.path package_dir = os.path.abspath(os.path.dirname(__file__)) database_path = os.path.join(package_dir, 'database.db') then wherever you need to have access to the database path, use from MainApp import configuration, after which you can access configuration.database_path to get that path.

Categories : Python

getting the full filenames from all top directory files in a specific directory and suppressing the occuring error
Did I understand correctly that you only need the File-names with directory-names. This code works for me, no elevations needed. private void button1_Click(object sender, EventArgs e) { string folder = @"C:windowsprefetch"; string filemask = @"*.pf"; string[] filelist = Directory.GetFiles(folder, (filemask)); //now use filelist[i] for any operations. }

Categories : C#

Makefile: copy perl/python files from source directory into build directory
Basically, when you run make X, you are telling Make to find target X in your Makefile. So if you have no install: target, nothing will happen. All of this really depends what is in your Makefiles. If you want to copy your perl/python files into the build directory, one way to do so is to write a Makefile target that runs a *sh command like mv dir2/*.pyc build; mv dir2/*.pl build, and require that target somewhere else in your Makefile. If you need a good Makefile tutorial, here's one that I started with.

Categories : C++

Moveuploaded files function in PHP moves the file to the temp directory but not to the destination directory
First time you called move_uploaded_file() you moved that file from temporary folder to $workDir. After that, uploaded file no longer exists in temporary directory. Just use rename() function to move that file from $workDir."/".$tmpName to final destination. // moves file from workdir to final destination rename($workDir."/".$tmpName, $_POST['filetype'].'/'.$rightname);

Categories : PHP

How can I copy only files and folder created in the past hour in one directory to a new directory?
Robocopy doesn't have the granularity, but XXcopy seems to handle it. /DA#30m selects files made within the last 30 minutes. XXcopy is free for non commercial use and can be downloaded from http://www.xxcopy.com XXcopy is xcopy on steroids.

Categories : Batch File

How do I enumerate through a directory in Objective-C, and essentially clear out all the directories of non-directory files?
Something like this will work: NSURL *rootURL = ... // File URL of the root directory you need NSFileManager *fm = [NSFileManager defaultManager]; NSDirectoryEnumerator *dirEnumerator = [fm enumeratorAtURL:rootURL includingPropertiesForKeys:@[NSURLNameKey, NSURLIsDirectoryKey] options:NSDirectoryEnumerationSkipsHiddenFiles errorHandler:nil]; for (NSURL *url in dirEnumerator) { NSNumber *isDirectory; [url getResourceValue:&isDirectory forKey:NSURLIsDirectoryKey error:NULL]; if (![isDirectory boolValue]) { // This is a file - remove it [fm removeItemAtURL:url error:NULL]; } }

Categories : Objective C

Copy files from source directory to target directory and exclude specific file types from specified directories
This is one way to do it $SourceDirectory = 'C:Source' $DestinationDirectory = 'C:Destination' $ExcludeExtentions = '*.txt*', '*.xml*' $ExcludeSubDirectory = 'C:Sourcead_directory1', 'C:Sourcead_directory2' Get-ChildItem $SourceDirectory -Recurse -Exclude $ExcludeExtentions | Where-Object { $ExcludeSubDirectory -notcontains $_.DirectoryName } | Copy-Item -Destination $DestinationDirectory Your best friend here is Where-Object, or where. It takes a scriptblock as parameter and uses that scriptblock to validate each object that goes through pipeline. Only objects that make script return $true are passed through Where-Object. Also, take a look at the object that represents a file you get from Get-ChildItem. It has Name, Directory and DirectoryName containing pieces of file's FullNam

Categories : File

Import a directory with files and force-overwrite even if the directory already exists
Read svn help import and use it. If you task really is Add unversion tree from custom location into existing repository svn import /PATH/TO/PROJECT protocol://URL/IN/REPOSITORY will add as result Project as child to URL/IN/REPOSITORY Just to note: import will appear as commit in repository

Categories : Svn

How to include multiple class files and .Jar files in class path which exist in sub folders in linux?
Use below command: export CLASSPATH="$CLASSPATH:xyz.jar**:**path_to_abc.jar.jar" You basically have to append to the classpath, all the new entries that you want. To do so, just make use of ':' in linux and ';' in windows.

Categories : Java

files with same name in different folders
Try this to get the files which have names in common: cd dir1 find . -type f | sort > /tmp/dir1.txt cd dir2 find . -type f | sort > /tmp/dir2.txt comm -12 /tmp/dir1.txt /tmp/dir2.txt Then use a loop to do whatever you need: for filename in "$(comm -12 /tmp/dir1.txt /tmp/dir2.txt)"; do cat "dir1/$filename" cat "dir2/$filename" done

Categories : Linux

How to add all new folders and files to Git?
Keep in mind that you cannot add folders under revision. The only thing you can add to git is content. If you want to add empty folders. Add empty files in them and add them to git however you want. One trick to add everything you want is to use the interactive mode of git. git add -i if you press numbers, you can switch from one menu to the other 2) Add changes 3) Revert changes 4) Untracked files 5) Patch I suggest to explore this command. When you are in a menu, enter the number of the file in the list. Ranges are also accepted. like 1-10 will select files from 1 to 10. -5-7 will unselect files from 5 to 7 Also if some files aren't visible in the lists, but should be visible check that you don't have a gitignore file somewhere that hides them.

Categories : GIT

Show on desktop, Then Hide Banner Advertisements on mobile
You can try hide the small ads by default at first by using display: none;. Under the media query make it visible by applying display: block; and hide the large ads. You can see the example here http://jsfiddle.net/tkxCk/

Categories : CSS

how to show hidden widget in desktop/panel with extjs?
Simple example. Panel with toolbar and button. Click on button show or hide toolbar. View: Ext.define('TEST.view.desktop.Desktop', { extend: 'Ext.panel.Panel', alias: 'widget.desktop.Desktop', initComponent: function () { var me = this; Ext.applyIf(me, { dockedItems: [ { xtype: 'toolbar', hidden: true } ], items: [ { xtype: 'button', action: 'testbutton' } ] }); me.callParent(arguments); } }); Controller: Ext.define('TEST.controller.desktop.Desktop', { extend: 'Ext.app.Controller', views: ['desktop.Desktop'], init: function () {

Categories : Javascript

JavaScript disabled: how to show different messages for mobile and desktop.
Is there any server backend to your website? You could try and do mobile browser detection based off of the user-agent received from the connecting browser. See this stackoverflow post about using the user agent to detect mobile.

Categories : Javascript

Show Vim relative paths with parent folders
Have you checked the mailing list? I found two helpful answers, but maybe you will find more. What abbreviates filenames in tab labels? has a ShortGuiTabLabel() function and a reminder for the pathshorten() Vim function. cut off complete file path of tabnames has another custom function. I'm not sure if these answer your question but they might help steer you in the right direction.

Categories : Vim

copying files from remote desktop using php
Yeah you can copy files from remote server if you have previlliages/rights here is link <?php if(!@copy('http://someserver.com/somefile.zip','./somefile.zip')) { $errors= error_get_last(); echo "COPY ERROR: ".$errors['type']; echo "<br /> ".$errors['message']; } else { echo "File copied from remote!"; } ?>

Categories : PHP

Window between desktop files and background
You've answered your own question. The window level is lower than the desktop so it won't receive mouse events because the desktop intercepts them. You might try using a global event monitor when your app is active and catch mouse events. But it's a hack already.

Categories : Objective C

Where is the format of .desktop files described (e.g. autostart)?
Here is the formal specification: http://standards.freedesktop.org/desktop-entry-spec/latest/ Hidden=true means to treat the desktop entry as if it had been deleted. NoDisplay=true means not to show the application in any menus, but still treat it as if it is installed, for example to associate a MIME type with it. Setting both at once seems to be redundant, or perhaps undefined.

Categories : Misc

How to concatenate files from different folders
Depending on your shell, this might work : cat {folder1,folder2,folder3}/output_*.txt. It uses brace expansion which is implemented in : Bash Zsh

Categories : Unix

folders downloading as files in ftp
The FTP methods don't support downloading of folders, or recursion, by themselves, so there's no other way I can think of doing this but what I've suggested below. Change the method so you can differentiate between files and directories and handle them accordingly. Change $ftprequest.Method = [System.Net.WebRequestMethods+Ftp]::ListDirectory to $ftprequest.Method = [System.Net.WebRequestMethods+Ftp]::ListDirectoryDetails Which will list in this format: -rwxrwxrwx 1 owner group 277632 Mar 4 17:15 xml_socket.log.rar Directories will have a d in place of the - at the start of the line. Here is an amended try block that will match only files so you can pass to the downloadFtp function: try { if(!($filename -match '^d')){if((Test-Path ("C:emsdropbox"+$filename.Spl

Categories : Powershell

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