I created the Terminal - Fundation project in Xcode, wrote a simple code that saves data to disk. If the path is specified to the document folder, then everything is perfectly preserved; if I specify an arbitrary path, the files are not created. What can be wrong? Chomd 755 did, ran as sudo, the result is the same.

  • Can you show the code? - Stanislav Pankevich
  • one
    And not only the code, but also an example of the way in which you are trying to save files - you never know. - VioLet
  • The code for writing data to the file is: [[NSKeyedArchiver archivedDataWithRootObject: testData] writeToFile: [currentPath stringByAppendingPathComponent: TEST_FILENAME] atomically: YES]; The path that does not save: "/Users/myname/Projects.localized" Saves only to the document folder. - ALiEN
  • The problem was that the path passed to the console utility was not converted from UTF8, but was used as is. As a result, the saving occurred only in folders with English names, the Russian-language folders looked like two-byte notation. Thanks to all. // Get current path NSString * currentPath; if (argc) {currentPath = [NSString stringWithUTF8String: argv [argc - 1]]; } - ALiEN