drive

determine if drive is removable (flash or HDD) knowing only the drive letter

一曲冷凌霜 提交于 2019-12-06 17:40:26
I am trying to determine if a file is on a local drive. I found GetDriveType() WINAPI which retrieves the drive type. However reading the description of the return values it seems, and thats how I understand it, that it retrieves a flash drive as FIXED which is not what I want. Its working fine on local drives: bool IsDriveRemovableOrRemote(CString driveRoot) { UINT driveType = GetDriveType(driveRoot); return (DRIVE_REMOVABLE == driveType || DRIVE_CDROM == driveType || DRIVE_NO_ROOT_DIR == driveType || DRIVE_REMOTE == driveType); } I don't have a flash/external drive to test ATM but I would

C# How to know if a given path represents a root drive?

為{幸葍}努か 提交于 2019-12-06 16:39:41
问题 How can I know if a given directory is a root drive? (aside from checking if its path equals to "A:", "B:", "C:", etc.) 回答1: Check if DirectoryInfo.Parent is null or not DirectoryInfo d = new DirectoryInfo(""); if(d.Parent == null) { IsRoot = true; } you can also get the root by using DirectoryInfo.Root; 回答2: It's much more complicated than checking the Parent property. Determining Whether a Directory Is a Mounted Folder One approach would be to see if GetVolumeNameForVolumeMountPoint

trying to convert xls to google spreadsheet using google app script and getting “Empty response” error

一世执手 提交于 2019-12-06 16:16:36
问题 I'm trying to convert a xls file to a google spreadsheet with the following code: var searchFor ="fullText contains 'theFile.xls' and '" + FolderId + "' in parents"; var files = DriveApp.searchFiles(searchFor); var file = files.next().getBlob(); var convertedFileinfo = { title: 'theFile', parents:[{id: FolderId}] }; Drive.Files.insert(convertedFileinfo, file, { convert: true, uploadType:'resumable' }) But i'm getting "Empty response" error on Drive.Files.insert line... What I'm doing wrong?

how to publish to the web a spreadsheet using drive API and GAS

大城市里の小女人 提交于 2019-12-06 15:36:58
I activate the drive API, (V2), and I try to publish to the web a file I try the following, but obviously, I miss something (the resource). Can somebody help me? many thanks in advance function test(){ var fileId = '1c5fRpKAk2YdUVzCa1LOCqDgTLZmYjsfSvTzR9BSGPYo'; var revisions = Drive.Revisions.list(fileId); var items = revisions.items; var revisionId = items[items.length-1].id; var resource; Drive.Revisions.update( resource , fileId, revisionId).published = true; } several months later, we got the solution !! //this function publish to the web the document given by ID (google sheets or docs)

How to check if content of google drive folder has changed?

本小妞迷上赌 提交于 2019-12-06 14:58:54
问题 I would like to do caching for folder content, therefore it will be cool if I can somehow get an information if folder in google drive changed and then flush the cache. Is there a way for that? Best in php. 回答1: After some time I came up with this nice solution: function isGoogleDriveFolderContentUpdated($lastTime, $folderId, &$client) { $appsactivityService = new Google_Service_Appsactivity($client); $optParams = array( 'source' => 'drive.google.com', 'drive.ancestorId' => $folderId,

Android, Google Drive: Google consent screen freezes

廉价感情. 提交于 2019-12-06 13:30:31
问题 I've upgraded my app to the Google Drive REST API and its Java wrappers, as described here: https://developers.google.com/drive/android/deprecation My code is very close to the official demo app provided by Google. I also cross-checked with other code examples I've found. The Google Drive API upgrade itself was successful, but now there are very few users that cannot log-in anymore. The Google consent screen displays a white box and the circle is rotating. No information is displayed at all.

Google's File Insert v2 API fails to recognise MIME TYPE application/vnd.google-apps.document

大兔子大兔子 提交于 2019-12-06 01:25:22
This morning, I tried using Google APIs File Insert where I provided MIME TYPE as application/vnd.google-apps.document. I am getting the following response from Google API HttpError: <HttpError 400 when requesting https://www.googleapis.com/upload/drive/v2/files?uploadType=resumable&alt=json returned "Invalid mime type provided"> I replaced MIME TYPE application/vnd.google-apps.document with application/msword and the API started working. Has anything changed with Google API? Google reported there was an outage https://www.google.com/appsstatus#hl=en&v=issue&sid=4&iid

Azure Blob storage vs Azure Drive

隐身守侯 提交于 2019-12-05 09:42:16
问题 I am looking at moving to Windows Azure rather than typical hosting however I'm unsure how best to store images. After searching I've found that there are 2 possible solutions - Blob storage or Azure drive. I have looked into Blob storage and although I have begun to get used to the idea it will require quite a lot of modification to our CMS. In my searching I have just stumbled across Azure Drive which if I understand correctly creates a virtual hard drive which allows your application to

Find file's parent id : Google Drive API V3

笑着哭i 提交于 2019-12-05 07:34:36
Today after I updated my Drive API to V3, I dint find any method to find the parent of the selected file . Is the rest endpoint to fetch json related to parent's info changed? If you have the file id of the file in question then Files: get you need to add fields ie parents along with the file id. Request GET https://www.googleapis.com/drive/v3/files/0B5pJkOVaKccENWNNcFFaU2lSM0E?fields=parents&key= {YOUR_API_KEY} Returns { "parents": [ "0B5pJkOVaKccEYW5lVHBKd1Zwc28" ] } The result is actually a file id. Remember files and directories are the same in Drive. Do files.get again GET https://www

List of file in a folder/ DRIVE API PyDRIVE

一曲冷凌霜 提交于 2019-12-05 05:54:50
I can't change folder and view what's inside. drive = GoogleDrive(gauth) file_list = drive.ListFile({'q': "'root' in parents and trashed=false"}).GetList() for file1 in file_list: print("File %s\n\n",(file1)) I used the following code: file_list = drive.ListFile({'q': "'/test1' in parents and trashed=false"}).GetList() but it doesn't work. There's the documentation of the functions I used: https://developers.google.com/drive/v3/reference/files/list You have to insert the folder ID instead of its path. You can get the ID in different ways: Using PyDrive: If you list all folders in root, you can