Skip to content

Resetting file time not permitted on Linux #6

@chrsmlls333

Description

@chrsmlls333

On Ubuntu 18.04, I received this error just after the first user in my config file had been downloaded successfully. This is related to file ownership which is stricter in linux environments. Luckily this only happened when saving to a network or external drive.

I think you should encapsulate this in a try catch and/or implement a config setting to disable this functionality. The ability to sort files is nice but spoofing dates is a little hacky and should not break your script if it fails.

Traceback (most recent call last):
File "main.py", line 54, in
main()
File "main.py", line 40, in main
download_users(api, config, args.option)
File "main.py", line 11, in download_users
result = api.save_users_artworks(config.users, config.save_dir)
File "/home/chris/Desktop/deviantart-scraper/lib/deviantart.py", line 204, in save_users_artworks
files = self.save_user_artworks(user, dir_path)
File "/home/chris/Desktop/deviantart-scraper/lib/deviantart.py", line 183, in save_user_artworks
utils.set_files_mtime(combined_files['name'], dir_path)
File "/home/chris/Desktop/deviantart-scraper/lib/utils.py", line 42, in set_files_mtime
os.utime(file_path, (ts - i, ts - i))
PermissionError: [Errno 1] Operation not permitted

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions