Notepad++ cached files location
I noticed it myself, and found the files inside the backup folder. You can check where it is using Menu:Settings -> Preferences -> Backup. Note : My NPP installation is portable, and on Windows, so YMMV.
I noticed it myself, and found the files inside the backup folder. You can check where it is using Menu:Settings -> Preferences -> Backup. Note : My NPP installation is portable, and on Windows, so YMMV.
You could use the copy() function : // Will copy foo/test.php to bar/test.php // overwritting it if necessary copy(‘foo/test.php’, ‘bar/test.php’); Quoting a couple of relevant sentences from its manual page : Makes a copy of the file source to dest. If the destination file already exists, it will be overwritten.
From MSDN’s “Naming a File or Directory,” here are the general conventions for what a legal file name is under Windows: You may use any character in the current code page (Unicode/ANSI above 127), except: < > : ” / \ | ? * Characters whose integer representations are 0-31 (less than ASCII space) Any … Read more
os.walk Use os.walk with next item function: next(os.walk(‘.’))[1] For Python <=2.5 use: os.walk(‘.’).next()[1] How this works os.walk is a generator and calling next will get the first result in the form of a 3-tuple (dirpath, dirnames, filenames). Thus the [1] index returns only the dirnames from that tuple.
Here’s some advice from someone with an environment where we have folders containing tens of millions of files. A folder stores the index information (links to child files & child folder) in an index file. This file will get very large when you have a lot of children. Note that it doesn’t distinguish between a … Read more
This will delete all the files in a directory (and below) that are size zero. find /tmp -size 0 -print -delete If you just want a particular file; if [ ! -s /tmp/foo ] ; then rm /tmp/foo fi
First and foremost, you should consider calling MimeTypeMap#getMimeTypeFromExtension(), like this: // url = file path or whatever suitable URL you want. public static String getMimeType(String url) { String type = null; String extension = MimeTypeMap.getFileExtensionFromUrl(url); if (extension != null) { type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); } return type; }
I would probably use something like: string path = “C:/folder1/folder2/file.txt”; string lastFolderName = Path.GetFileName( Path.GetDirectoryName( path ) ); The inner call to GetDirectoryName will return the full path, while the outer call to GetFileName() will return the last path component – which will be the folder name. This approach works whether or not the path … Read more
Try this: fs.readFile(__dirname + ‘/../../foo.bar’); Note the forward slash at the beginning of the relative path.
find . -type f -printf ‘%T@ %p\n’ \ | sort -n | tail -1 | cut -f2- -d” ” For a huge tree, it might be hard for sort to keep everything in memory. %T@ gives you the modification time like a unix timestamp, sort -n sorts numerically, tail -1 takes the last line (highest … Read more