How to find all links / pages on a website
Check out linkchecker—it will crawl the site (while obeying robots.txt) and generate a report. From there, you can script up a solution for creating the directory tree.
Check out linkchecker—it will crawl the site (while obeying robots.txt) and generate a report. From there, you can script up a solution for creating the directory tree.
Here is a simple function that can compress any file or directory recursively, only needs the zip extension to be loaded. function Zip($source, $destination) { if (!extension_loaded(‘zip’) || !file_exists($source)) { return false; } $zip = new ZipArchive(); if (!$zip->open($destination, ZIPARCHIVE::CREATE)) { return false; } $source = str_replace(‘\\’, “https://stackoverflow.com/”, realpath($source)); if (is_dir($source) === true) { $files … Read more
The current directory is a system-level feature; it returns the directory that the server was launched from. It has nothing to do with the website. You want HttpRuntime.AppDomainAppPath. If you’re in an HTTP request, you can also call Server.MapPath(“~/Whatever”).
In my opinion, directories should not be considered targets of your makefile, either in technical or in design sense. You should create files and if a file creation needs a new directory then quietly create the directory within the rule for the relevant file. If you’re targeting a usual or “patterned” file, just use make‘s … Read more
Although what Christophe suggested is a more Pythonic solution, the os module does have the os.access function to check access: os.access(‘/path/to/folder’, os.W_OK) # W_OK is for writing, R_OK for reading, etc.
If you have the directory name in myDirectoryPath, import java.io.File; … File dir = new File(myDirectoryPath); File[] directoryListing = dir.listFiles(); if (directoryListing != null) { for (File child : directoryListing) { // Do something with child } } else { // Handle the case where dir is not really a directory. // Checking dir.isDirectory() above … Read more
Specify /D to change the drive also. CD /D %root%
dir.Delete(true); // true => recursive delete
You can simply do the following : $fi = new FilesystemIterator(__DIR__, FilesystemIterator::SKIP_DOTS); printf(“There were %d Files”, iterator_count($fi));
Easy with Boost.Filesystem: create_directories #include <boost/filesystem.hpp> //… boost::filesystem::create_directories(“/tmp/a/b/c”); Returns: true if a new directory was created, otherwise false.