Rename folders without touching original files

Any questions? Need some help?
andreyy
Posts: 19
Joined: 09 Apr 2013, 15:42

Re: Rename folders without touching original files

Post by andreyy »

I tried to implement this logic to the script but haven't succeed. Could you pleas integrate this excerpt to the script? Thank you once again!!
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Rename folders without touching original files

Post by rednoah »

Yeah, should be getRenameLog() not getRenameMap() ...

Here you go:
http://pastebin.com/caKW5h3F
:idea: Please read the FAQ and How to Request Help.
andreyy
Posts: 19
Joined: 09 Apr 2013, 15:42

Re: Rename folders without touching original files

Post by andreyy »

Readnoah, thank you as always! Is it possible to make ln -s or ln instead of copying the rest of the files.
I mean is it possible to change this line to include linking files, not copying:

Code: Select all

_guarded{ f.copyTo(new File("D:/path/to/remainder")) }
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Rename folders without touching original files

Post by rednoah »

Replace:

Code: Select all

f.copyTo(new File("D:/path/to/remainder"))
With:

Code: Select all

execute('ln', '-s', f, "D:/path/to/remainder/${f.name}")
:idea: Please read the FAQ and How to Request Help.
andreyy
Posts: 19
Joined: 09 Apr 2013, 15:42

Re: Rename folders without touching original files

Post by andreyy »

Ufff, thanks!
The another problem I found is that hard link ln is not working for directories. It's impossible to set hard link to a directory.
So the scripts for LN without -s option is not working for some of the cases. When source is a disk directory itself. It looks like the directories must be created at the target first :(

The sad thing is all I try to do - is to make my Synology NAS and NFS client work with a plain folder of movies. I think it's quite often task.
andreyy
Posts: 19
Joined: 09 Apr 2013, 15:42

Re: Rename folders without touching original files

Post by andreyy »

Sorry for disturbing you once again. I'm wondering if it possible to solve the problem with the directories that are not created by the hard LN?
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Rename folders without touching original files

Post by rednoah »

That's technology issue.

With symlinks it works, but then NFS resolves symlinks client-side, and not server-side. Try something like FTP/SFTP/WebDAV/Samba instead.

Hardlinks on folders are not allowed on most filesystems because of the obvious issues with infinite recursion.

But why do you have folders anyway? Don't use folders, just pack disks into .iso images. FileBot prefers to work on files, but if you have organized things neatly already, and there is a movie.nfo file, then it'll take the folder, if you don't want that just delete all the .nfo files and it'll go back to work on the video files only and ignore all the other stuff. Also you can modify the script to adjust this behaviour as you'd like.
:idea: Please read the FAQ and How to Request Help.
Post Reply