directory

How to upload to a OneDrive shared folder programmatically with least user interaction?

时光毁灭记忆、已成空白 提交于 2019-12-11 12:58:50
问题 one question, if it's possible, how to upload files, to a shared OneDrive folder? I'd like to make an app, that would use the OneDrive as storage, but since OneDrive SDK requires user's login, I was wondering if it's possible to first programmatically share, or somehow with least user interaction have my app's users be able to access a folder from my own OneDrive for Business 1TB account and have them chunk upload the file there instead of uploading it to their own account? As I said, ideally

Adobe Air how to check if folder exists?

时光毁灭记忆、已成空白 提交于 2019-12-11 12:54:57
问题 Adobe Air (2.0) how to check if folder exists? (like folder C:\Program Files (x86) on windows) (code example needed, please) 回答1: I think you can use the following functions of the File class: var folder:File = File.userDirectory.resolvePath(folderPath); folder.isDirectory; The isDirectory property will return a Boolean depending on whether or not that folder exists. Hope that helps, debu 回答2: import flash.filesystem.File; var tempFold:File = File.userDirectory.resolvePath("FolderPath"); if

when including() or require() do I always have to use ../../ relative to my file? Is there a simple way?

断了今生、忘了曾经 提交于 2019-12-11 12:48:12
问题 I'm building a web app that has php files spread out through different directories, so a typical file may have several includes. All these files everywhere. a php file may look like this: include('../../some.php'); require('../../some.php'); and in another file you may have something like this: include('../../../../some.php'); require('../../../../some.php'); point being, this can get a little bit out of hand, and somewhat difficult to keep track of. Is there a way I can do this so that I don

Debugging GetAllFilesAndDirectories method, when there are empty sub-directories

浪子不回头ぞ 提交于 2019-12-11 12:43:58
问题 This method works to get the files, directories and sub-directories and their contents, UNLESS one of the sub-directories happens to be empty. public static IEnumerable<FileSystemInfo> GetAllFilesAndDirectories ( string dir ) { DirectoryInfo dirInfo = new DirectoryInfo( dir ); Stack<FileSystemInfo> stack = new Stack<FileSystemInfo>(); stack.Push( dirInfo ); while ( dirInfo != null || stack.Count > 0 ) { FileSystemInfo fileSystemInfo = stack.Pop(); DirectoryInfo subDirectoryInfo =

Folder chooser on Windows

让人想犯罪 __ 提交于 2019-12-11 12:35:21
问题 How can I call the folder default windows folder chooser. I'm using the call: QString path = QFileDialog::getExistingDirectory(parent, "", folder, QFileDialog::ShowDirsOnly); But this call show the dialog below: How can I choose this dialog as folder chooser? 回答1: You did everything correctly. I just tested this on an XP with Qt 4.7.0 and it works as you expect but when testing on Windows 8 with Qt 5.0.2, I get the ordinary file open dialog. I suggest you log this as a bug. 来源: https:/

Read remote directory with client-side javascript?

旧街凉风 提交于 2019-12-11 12:19:02
问题 I'd like to scan a directory on my server, using JS, and create a link to the most recent file in the dir. My server doesn't disallow directory listings; I can see the contents of the folder if I navigate to it. Is it possible to do this in straight JS? 回答1: All Javascript can do is HTTP requests and read whatever your server responds with. If your server doesn't give you any sort of directory listing over HTTP, then there's very little you can do with Javascript. If it does give you a

Get the number of files in a folder, omitting subfolders

橙三吉。 提交于 2019-12-11 12:16:08
问题 Is the any way to get the number of files in a folder using Java? My question maybe looks simple, but I am new to this area in Java! Update: I saw the link in the comment. They didn't explained to omit the subfolders in the target folder. How to do that? How to omit sub folders and get files in a specified directory? Any suggestions!! 回答1: One approach with pure Java would be: int nFiles = new File(filename).listFiles().length; Edit (after question edit): You can exclude folders with a

Java: How to create a new folder in Mac OS X

家住魔仙堡 提交于 2019-12-11 12:14:58
问题 I want to create a folder in ex. my desktop in Mac OS X I try to use this code, instead of Mymac is my name of course:) String path="/Users/Mymac/Desktop"; String house = "My_home"; File file=new File(path); if(!file.exists()) file.mkdirs(); // or file.mkdir() file=new File(path + "/" + house); try { if(file.createNewFile()) { } } catch (IOException ex) { ex.printStackTrace(); } Do you know how I could create a new folder? And another thing is when I want to create a folder in the directory

Lucene.Net Index all files in a folder

不羁岁月 提交于 2019-12-11 11:56:38
问题 Is there a way to index all files in a specific folder? Refer to a folder, and somehow add all the documents in the folder to the index without having to loop through all the files in the folder. In DtSearch, there was a method to "IndexFilesInFolder(foldername)" 回答1: There's a demo directory in the Lucene.Net source which includes examples how to index all files in a folder, and searches the index. It works for basic text documents, you'll need to handle other document types to extract their

Second newest file

半腔热情 提交于 2019-12-11 11:17:11
问题 I need the second newest file. In this thread the newest is found: Python get most recent file in a directory with certain extension which uses this construct: newest = min(glob.iglob('upload/*.log'), key=os.path.getctime) However, how can I get not the min or max but the second element? 回答1: I think this can be a suitable solution: # for the min + 1 sorted(glob.iglob('*.log'), key=os.path.getctime)[1] # for the newest sorted(glob.iglob('*.log'), key=os.path.getctime)[-1] # for the second