فهرست منبع

Fixed truncate issue

luis 7 سال پیش
والد
کامیت
d6a6e093f0
4فایلهای تغییر یافته به همراه17 افزوده شده و 11 حذف شده
  1. 1 1
      .gitignore
  2. 12 5
      README.md
  3. 1 1
      src/gdrivemount/cmd/gdrivemount/version.go
  4. 3 4
      src/gdrivemount/gdrive-fuse.go

+ 1 - 1
.gitignore

@@ -1,4 +1,4 @@
-deps/pkg
+deps
 vendor/pkg
 pkg
 bin

+ 12 - 5
README.md

@@ -29,15 +29,22 @@ As of Google drive guidance:
 >	6. Click OK to dismiss the resulting dialog.
 >	7. Click the file_download (Download JSON) button to the right of the client ID.
 
-Copy the downloaded JSON file to home directory as: 
-$HOME/.gdrivemount/client_secret.json
+Copy the downloaded JSON file to home directory as:    
+__$HOME/.gdrivemount/client_secret.json__   
 
+#### Signals
+Signal | Action                                                                                               | ex
+-------|------------------------------------------------------------------------------------------------------|-----------------
+USR1   | Refreshes directory tree from google drive                                                           | killall -USR1 gdrivemount
+HUP    | Perform a GC and shows memory usage <small>Works when its not running in daemon mode</small>         | killall -HUP gdrivemount
 
 
 
-TODO:
---------
+
+
+####TODO:
+* Assure concurrency support on inode/handle creation for gdrive
 * Improve caching to refresh and save inodes
 * Reverse package structure instead of gdrivemount/cmd/gdrivemount use this as main package and move logic to subpackage
-* Use cloudmount -t gdrive -o uid, gid  MOUNTPOINT // Cloudmount
+* Use cloudmount -t gdrive -o uid, gid  MOUNTPOINT and add Support for other cloud services
 

+ 1 - 1
src/gdrivemount/cmd/gdrivemount/version.go

@@ -2,5 +2,5 @@ package main
 
 const (
   //Version contains version of the package
-  Version = "0.0.1-1-g67aeb24 - built: 2017-07-07 04:03:29 UTC"
+  Version = "0.0.1-2-ge531499 - built: 2017-07-07 04:27:44 UTC"
 )

+ 3 - 4
src/gdrivemount/gdrive-fuse.go

@@ -301,17 +301,16 @@ func (fs *GDriveFS) ReadDir(ctx context.Context, op *fuseops.ReadDirOp) (err err
 // SetInodeAttributes Not sure what attributes gdrive support we just leave this blank for now
 func (fs *GDriveFS) SetInodeAttributes(ctx context.Context, op *fuseops.SetInodeAttributesOp) (err error) {
 
-	if op.Attributes.Size == 0 { // Request to truncate i supose?
+	// Hack to truncate file?
+	if op.Size != nil && *op.Size == 0 { // Request to truncate i supose?
 		f := fs.root.FindByInode(op.Inode, true)
 		err = fs.srv.Files.Delete(f.GFile.Id).Do() // XXX: Careful on this
-		createdFile, err := fs.srv.Files.Create(&drive.File{Name: f.GFile.Name}).Do()
+		createdFile, err := fs.srv.Files.Create(&drive.File{Parents: f.GFile.Parents, Name: f.GFile.Name}).Do()
 		if err != nil {
 			return fuse.EINVAL
 		}
 		f.SetGFile(createdFile) // Set new file
-
 	}
-	// Hack to truncate file?
 
 	return
 }