Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: building a Dummy



Axel Gruber wrote:
> 
> Hello List - hello Scriptwriters :-)
> 
> Here i still have the same situation:
>  - video0-8 (no -VFAT in VDR)
>  - All accessable in a SERVER via NFS
>  - Samba installed
> 
> I have the idea to connect to my Videofiles with my WINx clients
> trough SAMBA - but i donīt want to change anything in my Filesystem.
> (no -VFAT)
> 
> So i have the idea to create a mirror of the VIdeo0 directory in a Samba-Directory
> but with WINDOWS-compartible Filenames.
> 
> I made some experiments with symbolic links and yes - it works well.
> 
> What i need now is a small script wich do this things:
> 
> find /video0 -follow -name '*.vdr'
> 
> put the output of each line into a variable and create a symbolic link
> 
> ln -s `Variable1'` /mp35/links/
> 
> Now i have the problem that there yould be names of the movies in "/mp35/links/MOVIENAME/
> 
> So the Variable1 shuld be manipulated in a way that i get as output only the Moviename
> For example:
> /video0/Hasch#5Fmich#5Fich#5Fbin#5Fder#5FMoerder/2002-03-14.21:45.50.98.rec/001.vdr
> into: Variable2=Hasch#5Fmich#5Fich#5Fbin#5Fder#5FMoerder
> 
> Ok - now we can make:
> ln -s `Variable1'` /mp35/links/Variable2
> 
> And now in a loop to the end of the find results.
> 
> I know iīm not a Programmer - so please forgive me if my idea is wrong
> but this is my old Pascal/Basic knowledge :-)
> 
> If anyone have a Idea  - please let me know !

Well, I'm not sure if I fully understand what you want to achieve, and I believe
your description may lack some details. Anyway, here's a little Perl script that
tries to implement your idea:

------------------------------------------------------------
#!/usr/bin/perl

$VIDEO = "/video0";
$LINKS = "/mp35/links";

for (`find $VIDEO -follow -name '*.vdr'`) {
    chomp;
    $Variable1 = $_;
    print "ln -s '$Variable1' '$LINKS/'\n";
    if (/001\.vdr/) {
       s/\/[^\/]*\/[^\/]*$//;
       $Variable2 = $_;
       print "ln -s '$Variable1' '$LINKS/$Variable2'\n";
       }
    }
------------------------------------------------------------

It prints out the command rather than executing them, since I'm afraid
thy wouldn't do what you have in mind.

Maybe it's useful to you, anyway...

Klaus
-- 
_______________________________________________________________

Klaus Schmidinger                       Phone: +49-8635-6989-10
CadSoft Computer GmbH                   Fax:   +49-8635-6989-40
Hofmark 2                               Email:   kls@cadsoft.de
D-84568 Pleiskirchen, Germany           URL:     www.cadsoft.de
_______________________________________________________________




Home | Main Index | Thread Index