googleinterns / filesystem-in-appsscript

Apache License 2.0
5 stars 1 forks source link

File locking within same process #63

Open satviksr opened 4 years ago

satviksr commented 4 years ago

Even though we have deferred proper file locking, we can implement same process file locking.

APIs: File IO - Open, Close FileSystemObject - OpenTextFile DirectoryManager - Kill, Name

Cases:

  1. FileIO -> cannot open same file 2 times irrespective of the iomode
  2. FileSystemObject
    • Can open a file in read mode multiple times
    • Can open a file in read mode multiple times + One time in write mode
    • Cannot open a file in write mode more than once

FileSystemObject - Write Mode + FileIO Write mode not allowed But FileSystemObject - Write Mode + FileIO Read mode allowed