Where is the correct place to store my application specific data?

Question 2: I suggest using a subfolder in Environment.SpecialFolder.CommonAppData (maps to C:\ProgramData on Windows7 by default). This is a hidden folder. Question 3: Put those files into Environment.SpecialFolder.AppData(maps to C:\Users\[USERNAME]\AppData\Roaming by default, hidden folder), if you expect that the user does not intend to backup / modify those. Some games also put their save games … Read more

How to delete ALL FILES in a specified directory on the app?

NSFileManager *fm = [NSFileManager defaultManager]; NSString *directory = [[self documentsDirectory] stringByAppendingPathComponent:@”Photos/”]; NSError *error = nil; for (NSString *file in [fm contentsOfDirectoryAtPath:directory error:&error]) { BOOL success = [fm removeItemAtPath:[NSString stringWithFormat:@”%@%@”, directory, file] error:&error]; if (!success || error) { // it failed. } } I leave it up to you to do something useful with the error … Read more

Best way to get files from a dir filtered by certain extension in php [duplicate]

PHP has a great function to help you capture only the files you need. Its called glob() glob – Find pathnames matching a pattern Returns an array containing the matched files/directories, an empty array if no file matched or FALSE on error. Here is an example usage – $files = glob(“/path/to/folder/*.txt”); This will populate the … Read more

Creating hidden folders

using System.IO; string path = @”c:\folders\newfolder”; // or whatever if (!Directory.Exists(path)) { DirectoryInfo di = Directory.CreateDirectory(path); di.Attributes = FileAttributes.Directory | FileAttributes.Hidden; }