草庐IT

DOCUMENTS

全部标签

javascript - 使用 PhoneGap 将文件从 www 复制到 'Documents'

我正在尝试将存储在phonegap文件夹(www/default_files/file.txt)中的文件复制到iOS中的文档文件夹,到目前为止我得到的是:window.requestFileSystem(LocalFileSystem.PERSISTENT,0,function(fileSys){fileSys.root.getFile("file.txt",null,function(theFile){//fileexistdon'tdoanything},function(error){//filedoesnotexist,socopyitfileSys.copyTo(fileSy

ios - MPMoviePlayerController 不从 Documents 文件夹播放

绝望。大家好!我在使用MPMoviePlayerController时遇到了一些问题。我已经让它与来自NSBundle的视频一起工作。但这不是我需要的。我需要从Documents目录播放它,因为那是我存储录制视频的地方,URL存储在CoreData中。但是让我们把这个放在一边,将代码简化到最低限度。如果使用contentURL,这段代码实际上是有效的,这会导致NSBundle。之后,我要做什么才能到达文档位置。我的工作:NSURL*contentURL=[[NSBundlemainBundle]URLForResource:@"Oct_08_2012_10_00_51"withExte

iphone - Documents 目录中的读/写文件问题

我正在尝试将一个非常基本的文本字符串写入我的文档目录并从那里开始工作以稍后保存其他文件等。我目前坚持不在我的文档目录中写入任何内容(在我的viewDidLoad中)NSArray*pathArray=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES)NSString*documentsDirectory=[pathArrayobjectAtIndex:0];NSString*textPath=[documentsDirectorystringByAppendingPathCompon

ios - 大文件下载到 Documents 并备份到 iCloud

我在应用商店中有一个iOS应用,可以下载需要保留在设备上以供离线使用的相对较大的文件。这些文件目前存储在应用程序的Documents文件夹中,但我刚刚读到Documents文件夹已备份,实际上应该只用于用户生成的内容。ThisAppletechnicalQ&A指出应设置NSURLIsExcludedFromBackupKey以防止备份。This声明应用程序的/Library/Caches是放置此类文件的正确位置,但进一步阅读表明当设备存储空间不足时可能会清除该文件夹,这对于该应用程序来说是NotAcceptable。我相信/Library/ApplicationSupport/是他们的

ios - UIDocumentPickerViewController -> "No Documents"因为 iCloud 不可用

我使用这个方法来显示一个UIDocumentPicker:funcshowDocumentPicker(){letdocPicker=UIDocumentPickerViewController(documentTypes:["public.composite-content"],inMode:UIDocumentPickerMode.Import)docPicker.delegate=selfdocPicker.modalPresentationStyle=UIModalPresentationStyle.FullScreenself.presentViewController(do

java - 如何在 Java 中查找 "My Documents"文件夹

我愿意在用户的“我的文档”文件夹中保存一个文件。我试过这样获取位置:System.getenv("USERPROFILE")+"\\MyDocuments\\"然后,我意识到这在语言设置为另一种语言(例如法语)的系统中不起作用。是否有另一种有效获取“我的文档”文件夹的方法? 最佳答案 关于性能,这比使用JFileChooser更快:FileSystemView.getFileSystemView().getDefaultDirectory().getPath()在我的PC中,JFileChooser方法需要300ms,而直接调用Fi

python 和XML : how to place two documents into a single document

这是我的代码:defextract_infos(i):blabla...blablacalculatev...dom=xml.dom.minidom.parseString(v)returndomdoc=xml.dom.minidom.Document()foriinrange(1,100):dom=extract_infos(i)forchildindom.childNodes:doc.appendChild(child.cloneNode(True))然后最后两行工作一次:Traceback(mostrecentcalllast):File"./c.py",line197,indo

Python TfidfVectorizer 抛出 : empty vocabulary; perhaps the documents only contain stop words"

我正在尝试使用Python的Tfidf来转换文本语料库。但是,当我尝试对其进行fit_transform时,出现值错误ValueError:emptyvocabulary;也许文档只包含停用词。In[69]:TfidfVectorizer().fit_transform(smallcorp)---------------------------------------------------------------------------ValueErrorTraceback(mostrecentcalllast)in()---->1TfidfVectorizer().fit_tran

python - 你如何获得 "My Documents"的确切路径?

在C++中,获取shell在WindowsXP和Windows7中称为“我的文档”以及在Vista中称为“文档”的文件夹的完整路径名并不难;见GetpathtoMyDocuments有没有在Python中执行此操作的简单方法? 最佳答案 您可以使用ctypes模块获取“我的文档”目录:importctypesfromctypes.wintypesimportMAX_PATHdll=ctypes.windll.shell32buf=ctypes.create_unicode_buffer(MAX_PATH+1)ifdll.SHGetS

iOS:无法将文件保存到 'Application Support' 文件夹,但可以保存到 'Documents'

我可以下载二进制文件并将其保存到具有自定义名称的“Documents”文件夹中。如果我只是将URL更改为“ApplicationSupport”文件夹而不是“Documents”文件夹,它将无法写入该URL,表示它不存在。这是URL构造代码:-(NSURL*)getSaveFolder{NSURL*appSupportDir=nil;NSURL*appDirectory=nil;NSArray*possibleURLs=[[NSFileManagerdefaultManager]URLsForDirectory:NSApplicationSupportDirectoryinDomain