publish empty directories to a web application in VS2010 web project

No this is not possible I’m afraid we had the same problem. You need to create a placeholder.txt file in each empty directory if you want the precompilation tool to generate these empty folders. Failing that you can create a command line app that will create the folders in your post build events (but only … Read more

Iterate through folders, then subfolders and print filenames with path to text file

Charles’ answer is good, but can be improved upon to increase speed and efficiency. Each item produced by os.walk() (See docs) is a tuple of three items. Those items are: The working directory A list of strings naming any sub-directories present in the working directory A list of files present in the working directory Knowing … Read more

directories in a zip file when using java.util.zip.ZipOutputStream

ZipOutputStream can handle empty directories by adding a forward-slash / after the folder name. Try (from) public class Test { public static void main(String[] args) { try { FileOutputStream f = new FileOutputStream(“test.zip”); ZipOutputStream zip = new ZipOutputStream(new BufferedOutputStream(f)); zip.putNextEntry(new ZipEntry(“xml/”)); zip.putNextEntry(new ZipEntry(“xml/xml”)); zip.close(); } catch(Exception e) { System.out.println(e.getMessage()); } } }

How to list the files in current directory?

Try this,to retrieve all files inside folder and sub-folder public static void main(String[]args) { File curDir = new File(“.”); getAllFiles(curDir); } private static void getAllFiles(File curDir) { File[] filesList = curDir.listFiles(); for(File f : filesList){ if(f.isDirectory()) getAllFiles(f); if(f.isFile()){ System.out.println(f.getName()); } } } To retrieve files/folder only public static void main(String[]args) { File curDir = new … Read more

Check if directory is empty in Ruby

Ruby now has Dir.empty?, making this trivially easy: Dir.empty?(‘your_directory’) # => (true|false) In Rubies prior to 2.4.0 you can just get a list of the entries and see for yourself whether or not it’s empty (accounting for “.” and “..”). See the docs. (Dir.entries(‘your_directory’) – %w{ . .. }).empty? # or using glob, which doesn’t … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)