TheLastGimbus / GooglePhotosTakeoutHelper

Script that organizes the Google Takeout archive into one big chronological folder
https://aur.archlinux.org/packages/gpth-bin
Apache License 2.0
3.88k stars 191 forks source link

Unhandled exception: FileSystemException: Cannot rename file #159

Closed fbnystn closed 1 year ago

fbnystn commented 1 year ago

Hi,

I tried to use the latest version of your takeout helper on mac -> version 3.3.1. After everything was extracted the tool tries to rename/move some files i guess... anyhow in this case it throws an unhandled exception.

........................................ 0/11396Moving files to output folder : ........................................ 1/11396  
Unhandled exception:
FileSystemException: Cannot rename file to '/Volumes/external SSD/helper-extract/._IMAG0375_1(1).jpg', path = '/Volumes/external SSD/helper-extract/.gpth-unzipped/Takeout/Google Fotos/Photos from 2012/._IMAG0375_1.jpg' (OS Error: No such file or directory, errno = 2)
#0      _File.rename.<anonymous closure> (dart:io/file_impl.dart:305)
<asynchronous suspension>
#1      main (file:///Users/runner/work/GooglePhotosTakeoutHelper/GooglePhotosTakeoutHelper/bin/gpth.dart:349)
<asynchronous suspension>

running MacOS Ventura 13.1 (22C65)

let me know if you need more information 👍

TheLastGimbus commented 1 year ago

ummm :raised_eyebrow:

._IMAG0375_1.jpg - looks like this file is hidden... i mean it's just a filename, but is this a problem on macos or something?

i also see you're on extrenal drive... does gpth have permissions for it?

fbnystn commented 1 year ago

i did some research :) ... so first of all the hidden file is in the hidden folder that is being created by the takeout helper itself. Then I checked if the file is already existing in the GoogleTakeout itself, but it isn't -> so it must be created by the takeout helper. I checked out the code from here and it's running perfectly now.

I have no clue why this was happening -> maybe it's caused by the async write when unzipping everything? ... anyhow it's working fine now :)

TheLastGimbus commented 1 year ago

oh...

um, sooo, this may be a bug in archive package - meaning, i can't do much about it :partying_face:

I suppose you extracted yourself and ran with cli?

happy that it works now!!

palijn commented 1 year ago

Hi guys, these ._ files are the resource forks of the regular files. They would not appear on an Apple filesystem (HFS+ or APFS) but your external SSD is most probably formatted in a non-Apple filesystem like exFAT, so your Mac has to store that data somewhere and it is in these additional files. Resource forks are seldom used today for anything useful AFAIK. They might contain a low-resolutions picture if you opened the picture in an app that does this, or a file-specific icon. Usually these resource forks are just empty, so one can :

TheLastGimbus commented 1 year ago

Wow, very useful ; i would never think of that... thanks @palijn !!