Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore dot files when using non-AppleFS on Mac #203

Open
palijn opened this issue May 4, 2023 · 16 comments · May be fixed by #297
Open

Ignore dot files when using non-AppleFS on Mac #203

palijn opened this issue May 4, 2023 · 16 comments · May be fixed by #297

Comments

@palijn
Copy link

palijn commented May 4, 2023

I've just ran GPTH on a Takeout tree that was uncompressed and managed on MacOS, on an exFAT filesystem (this is an important detail).

It failed with

Moving photos to output folder : ........................................ 1/26501  Unhandled exception:
PathNotFoundException: Cannot rename file to 'Takeout-GPTH/ALL_PHOTOS/date-unknown/._2012-12-19 09.34.20.jpg', path = 'Takeout/Google Photos/Photos from 2012/._2012-12-19 09.34.20.jpg' (OS Error: No such file or directory, errno = 2)
#0      _checkForErrorResponse (dart:io/common.dart:42)
#1      _File.rename.<anonymous closure> (dart:io/file_impl.dart:318)
<asynchronous suspension>
#2      moveFiles.moveFile (package:gpth/moving.dart:132)
<asynchronous suspension>
#3      moveFiles (package:gpth/moving.dart:137)
<asynchronous suspension>
#4      main.<anonymous closure> (file:///Users/runner/work/GooglePhotosTakeoutHelper/GooglePhotosTakeoutHelper/bin/gpth.dart:365)
<asynchronous suspension>

Actually there have been lots of errors of the kind of Can't get date on Takeout/Google Photos/Sans titre(40)/._IMG-75ca9ab6bc90579b54ac9b0f052041b6-V.jpg
They are resource forks in the AppleDouble format. I don't think those resources would even be useful on anything but MacOS, and anyway they can be recreated at will (nowadays).
Maybe GPTH can simply ignore them ?

The usual workaround is to run dot_clean Takeout , which I am currently running and should fix the issue.

@TheLastGimbus
Copy link
Owner

TheLastGimbus commented May 7, 2023

hmm, maybe i can just add

if(Platform.isMac) {
  Process.run('dot_clean -m $inputFolder');
}

at the beginning 👀 ? - is it okay to do it on mac (won't break anything etc)

@palijn
Copy link
Author

palijn commented May 7, 2023

In my case it was ok.
Please note that :
1- it might take a long time without progress information on large file trees
2- the dot files might reappear in the middle of GPTH processing if the user does things like casually browsing the folder contents, so it's not foolproof

I would think that there is no legitimate reason for GPTH to try processing a file starting with dot, so it might be better to ignore them rather than try suppressing them ?

Note again, those files won't even exist if the disk is using a native Apple filesystem. They will would pop up in existence if the Takeout is done on another filesystem like exFAT, or through CIFS/SMB. (Like, uncompressing Takeout over the network and processing gpth on the server.)

@TheLastGimbus TheLastGimbus changed the title Ignore dot files ? Ignore dot files when using non-AppleFS on Mac Jun 14, 2023
@TheLastGimbus TheLastGimbus pinned this issue Jun 14, 2023
@TheLastGimbus
Copy link
Owner

ehh, i will just pin this for now and see if anyone has such problem again...

@Pancham97
Copy link

Pancham97 commented Jun 25, 2023

Hi, didn't take long, but yes, I am facing the same issue with the same Ex-FAT FS. But dot_clean helped me out with that.

@ktang16
Copy link

ktang16 commented Dec 11, 2023

Ran into this issue today, but I unfortunately don't have the zip folders to restart the process. Maybe the readme should mention that you should keep the zip files in case the process fails?

@TheLastGimbus
Copy link
Owner

yep, done it 👌

@Spageddie28
Copy link

Hey, code noob here,

Where do I put the "dot_clean" thing?

@Pancham97
Copy link

Hey, code noob here,

Where do I put the "dot_clean" thing?

Hey @Spageddie28 I wrote a blog about the same. Hope this helps: https://panchamkhaitan.com/blog/my-rant-on-google-takeout-for-photos

@TheLastGimbus
Copy link
Owner

blog

oh, nice!

image

821533e

😭 i will add this in cmd text okay 😭

"Modified date" of all files. If you recall uploading files to iCloud, you would know that it likes to store in order of "Creation date".

ehh, right. It's time to migrate to other programming lanugage... again.. (since Dart doesn't support this)

But you could do this easier with exiftool

anyway, a nice blog. I hope that maybe in aaaaa..... year? I will solve all those issues with gpth too :DDD

@Pancham97
Copy link

Hey @TheLastGimbus, did you try running the Terminal command I have mentioned in the blog? Did that not help with the creation date?

@TheLastGimbus
Copy link
Owner

the for f in *.[iI][mM][gG]; do m=.... ? do you suggest i could use it as a sub-command in gpth itself? Mayyybe, but it's an OS/shell dependent thing (i would need 3 versions) that's very easy to break and mess up

@Pancham97
Copy link

the for f in *.[iI][mM][gG]; do m=.... ? do you suggest i could use it as a sub-command in gpth itself? Mayyybe, but it's an OS/shell dependent thing (i would need 3 versions) that's very easy to break and mess up

I can understand. By the way, great work with this tool, @TheLastGimbus! If you're working on something, I'd love to collaborate with you on that.

@jestlin15
Copy link

Hi @Pancham97 , thank you for the informative blog. Can I please ask, when do I run the for f in *.[iI][mM][gG]; do m="$(stat -f'%Sm' -t "%m/%d/%Y %H:%M:%S" "$f")"; SetFile -m "$m" -d "$m" "$f"; done code? After I did the steps for by Gpth or before?

@Pancham97
Copy link

Hi @Pancham97 , thank you for the informative blog. Can I please ask, when do I run the for f in *.[iI][mM][gG]; do m="$(stat -f'%Sm' -t "%m/%d/%Y %H:%M:%S" "$f")"; SetFile -m "$m" -d "$m" "$f"; done code? After I did the steps for by Gpth or before?

Hey @jestlin15, I maybe mistaken given that I wrote this blog a while ago, but I think I didn't use gpth for the second try. I went with another tool. It basically does the same thing as gpth. So, maybe, you need to try the for f in *... after gpth operations have exited successfully.

@Randomblock1 Randomblock1 linked a pull request Mar 14, 2024 that will close this issue
@zhaotianjing
Copy link

I have the same issue and I'm using Mac.

Error message is:

Finding albums (this may take some time, dont worry :) ...
Moving photos to output folder : ........................................ 1/45649 Unhandled exception:
PathNotFoundException: Cannot rename file to '/Volumes/SeagateExp/output/ALL_PHOTOS/._20191128_172905(1).jpg', path = '/Volumes/SeagateExp/Takeout/Takeout 2/Google Photos/Photos from 2019/._20191128_172905.jpg' (OS Error: No such file or directory, errno = 2)

I don't have a file named ._20191128_172905.jpg but I have 20191128_172905.jpg

@TheLastGimbus
Copy link
Owner

TheLastGimbus commented Mar 31, 2024

Well do you have "show hidden files" enabled?

Anyway, apple may go as far as not showing those files at all in their own viewer but they are there... Or something 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants