mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
Pavel Machek's zoofs patch
This commit is contained in:
parent
89d7d62094
commit
959885252a
@ -1,4 +1,14 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Zoo file system
|
||||
#
|
||||
# Copyright ? U. N. Known
|
||||
#
|
||||
# This filesystem is _dangerous_. It used to create symlinks in filesystem
|
||||
# with zoo file, it used to happily delete file from your filesystem.
|
||||
# Now it is 'only' very ugly (it creates temporary files in ~/.mc/
|
||||
#
|
||||
|
||||
ZOO=zoo
|
||||
|
||||
mczoofs_list ()
|
||||
@ -32,13 +42,18 @@ mczoofs_copyout ()
|
||||
}
|
||||
|
||||
# zoo is stupid and won't be happy when the name has no extension.
|
||||
# We have to do a small trick :)
|
||||
if echo $2 | grep '\.zoo'; then
|
||||
# We have to do a small trick :) [pretty dirty, broken hack -- pavel]
|
||||
if echo $2 | grep '\.zoo$'; then
|
||||
:
|
||||
else
|
||||
SYMLINK=$2.zoo
|
||||
SYMLINK=~/.mc/temporary.$2.zoo
|
||||
if test -f $SYMLINK; then
|
||||
SYMLINK=$2.
|
||||
SYMLINK=~/.mc/temporary.$2.
|
||||
fi
|
||||
if test -f $SYMLINK; then
|
||||
echo "Ugh. I did not expect this to happen. Cleanup your ~/.mc."
|
||||
sleep 5
|
||||
exit 1
|
||||
fi
|
||||
ln -s $2 $SYMLINK
|
||||
trap 'rm -f $SYMLINK' 0 1 2 3 5 13 15
|
||||
|
Loading…
Reference in New Issue
Block a user