Re: [go-nuts] File size of Google docs when mounted

2023-10-07 Thread Mandolyte
For the sake of posterity... here is what Bard says. *Prompt*: In golang, develop code to find the size of a google doc *Response*: To find the size of a Google Doc in Golang, you can use the following steps: 1. Import the necessary packages: import ( "context" "fmt" "io/ioutil"

Re: [go-nuts] File size of Google docs when mounted

2023-10-05 Thread Mandolyte
Yeah, I need someone who knows something about how gdrive does things. Thanks for the help! On Thursday, October 5, 2023 at 7:43:08 PM UTC-4 Kurtis Rader wrote: > Did you notice the `ls` command reports the file size is 170? The same as > your program? Also, `ls` does not indicate the file is

Re: [go-nuts] File size of Google docs when mounted

2023-10-05 Thread Kurtis Rader
Did you notice the `ls` command reports the file size is 170? The same as your program? Also, `ls` does not indicate the file is a symlink so the fact that ioutil.ReadDir presumably behaves the same as os.ReadDir (i.e., both use os.Lstat()) that isn't an issue. So for whatever reason the Google

Re: [go-nuts] File size of Google docs when mounted

2023-10-05 Thread Mandolyte
Here is what I see: $ ls -l Household\ Cleaning.gdoc -rw-r- 1 cecil chronos-access 170 Apr 22 15:30 'Household Cleaning.gdoc' $ I'll update the code to remove the deprecated and see if that is any different. On Thursday, October 5, 2023 at 6:06:50 PM UTC-4 Kurtis Rader wrote: > Note that

Re: [go-nuts] File size of Google docs when mounted

2023-10-05 Thread Kurtis Rader
Note that ioutil.ReadDir() has been deprecated since Go 1.16. Which is a very long time. Its documentation is ambiguous but given the behavior you're reporting I would guess it is using the equivalent of os.Lstat() and the "files" you're dealing with are symlinks. Note that os.ReadDir() (which

Re: [go-nuts] File size of Google docs when mounted

2023-10-05 Thread Mandolyte
Thanks for responding! The entire program may be found here: https://go.dev/play/p/4kLaeWeQG0Z The size comes from os.FileInfo, which is: type FileInfo interface { Name() string // base name of the file Size() int64 //

Re: [go-nuts] File size of Google docs when mounted

2023-10-05 Thread Kurtis Rader
It would help if you showed us the relevant code. My first guess is those files are symlinks. Or perhaps this is simply what Google Drive reports when a file is stat()'d. What does `ls -l` show? On Thu, Oct 5, 2023 at 8:31 AM Mandolyte wrote: > I have a program that given a starting folder will

[go-nuts] File size of Google docs when mounted

2023-10-05 Thread Mandolyte
I have a program that given a starting folder will walk the directory structure and report file sizes and other things. I recently tried to run this code on a mounted Google Drive on ChromeOS Linux. All the google docs report a size 170 bytes. Snippet: [image: Screenshot 2023-10-05 11.29.44