IRSSI w DCC: Any way to download to a fast drive (ie ssd) and have irssi send completed downloads to another folder (ie NAS) reddit / irc ---------------------------------------------------------------------- humanmeat · 2018-03-19 18:13 MIRC has this as a basic feature I read all the docs, no variables, doesn't seem like it's native to irssi. I googled and googled, nothing found. I also looked for post processing scripts that basically would do same thing and didn't see anything relevant (I may be a bad googler) Thanks ---------------------------------------------------------------------- ne7split · 2018-03-19 18:42 Irssi supports Perl scripting. * There's a bit of documentation [here](https://github.com/irssi/irssi/blob/master/docs/perl.txt) and a nice guide [here](https://github.com/shabble/irssi-docs/wiki/Guide). * There are signals for DCC events [here](https://github.com/irssi/irs si/blob/master/docs/signals.txt#L181). For starters, you might start with something like (untested): #!/usr/bin/env perl use strict; use warnings; use Data::Dumper; use Irssi; use Irssi::Irc; sub dcc_file_transfer_finished { my ($server, @args) = @_; print Dumper(@args); # see what's in @args # example - run a system command `ls -l ~`; return 1; } Irssi::signal_add('dcc receive', 'dcc_file_transfer_finished'); Have a go - if you can't get it working I'll knock together a full script after work. ---------------------------------------------------------------------- humanmeat · 2018-03-19 19:57 Hey thanks buddy, looks pretty straightforward, I'll just swap out that ls and let you know, don't go outta your way to write it yet... ---------------------------------------------------------------------- ne7split · 2018-03-19 20:35 No worries, let me know if you need any pointers. That signal may not be quite right (under the DCC list on "signals.txt" there are a few that could feasibly be the "end" of a DCC) so that might be worth tinkering with. ---------------------------------------------------------------------- humanmeat · 2018-03-19 22:46 I had to go find another library to load to get the incoming name of the dcc file to move it explicitly (rather than a mv *.* which would be an issue if there was other pending downloads) ... and I stumbled upon another script that was almost right there: https://github.com/irssi/scripts.irssi.org/blob/master/scripts/dccmove .pl I just had the remove the period to allow it to send an absolute path: 29: $dir .= "/done"; 29: $dir = "/MY_ABSOLUTE_PATH"; Works as I wanted, and signals report correctly I'm sure I'll find some use case scenario later on that need it to be tweaked Thanks for the help, and the offer, you're very kind. **PS** - This script was a workaround, main issue is irrsi can't write to any file system that doesn't support storing access control metadata (ie a chmod) If you were hoping for a script challenge and you're eager to solve a riddle .. IRSSI is coded to enforce the umask of the incoming file just before a DCC send.. This is an issue for those of us with a DCC target with a disk format (exFAT, CIFS) that doesn't support linux perms. Irssi tries to send a chmod and it bombs all transfers with a failed condition 2 ways I could guess it would work: Easier way Now the tiny script would just have to grab the incoming DCC filename, run a "touch $DIR/$DCCFILENAME", prior to DCC send and download will work... it basically resumes, ignoring the chmod call (this might be more complicated with many sequential files coming in) Harder way, but less hacky: Script would have conditions to ignore default umask (dcc_file_create_mode = 644) variable or some other way around block of code seen below I already tried another hard way, I traced it back to the source code to try to change it to ignore perms, and recompile, but no luck Just so you can see what's goin on, here's the activity: https://github.com/irssi/irssi/blob/master/src/irc/dcc/dcc-get.c Starting at line 241: else { if (fchmod(temphandle, dcc_file_create_mode) != 0) g_warning("fchmod(3) failed: %s", strerror(errno)); /* proceed even if chmod fails */ ret = 0; } You can see the dev tried to address this in the comment, but it's still failing when writing to exFAT Now this is a bit more complicated.. Any script ideas? If it worked, it would be a useful script to post on their site as there's a few people waiting for this to be resolved ---------------------------------------------------------------------- KindOne · 2018-03-21 15:32 Your internet and LAN speed are faster than your NAS? ---------------------------------------------------------------------- humanmeat · 2018-03-21 15:46 they were... yeah... I kept up to date on my ISP and plum forgot about my reliable 10base-t intranet architecture. I have 120 mbps, so 16MB/s down Story is I just added a gigabit router for the first time last year (I had the old trusty WRT54GL and I hated retiring it) I don't often have a need for more than 11-12MB/s throughput locally so I never really noticed my NAS was underperforming, I only noticed when I wanted to grab a bunch of videos for vacation It wasn't until after I posted this that I remembered when I got my 54gl over 10 years ago, I took my old non wifi linksys router and set it up in bridge mode to use as a sudo switch ... It had been so long I forgot it was there .. and it was in between my gigabit router and my NAS .. Ordered a 8 port gigabit switch from Amazon with one day prime, 30 bucks, problem solved I was more amazed you can plug inbound/outbound cables into anywhere in the switch, ie no dedicated wan port It's really a tribute to network gear that just works so well and for so long you forget they're there ---------------------------------------------------------------------- ne7split · 2018-03-21 18:03 Seen this - I'll try and brain something up. ---------------------------------------------------------------------- humanmeat · 2018-03-21 19:04 Go Brain!