Ticket #4578 (closed defect: duplicate)

Opened 3 months ago

Last modified 3 months ago

Cannot create temporary directory /tmp/mc-235078: File exists (17).

Reported by: gv Owned by:
Priority: major Milestone:
Component: mc-core Version:
Keywords: Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description

I got this error after applying the commit 1e299eefe7a12a3c707997f918056d1a22c2e49c (Ticket #4575: fix mc-wrapper to fit changes in #4535). The shell is tcsh.

$ mc
$ mcedit dummy.txt
Cannot create temporary directory /tmp/mc-235078: File exists (17).
Temporary files will not be created
Press any key to continue...

How to reproduce:

  1. Set EDITOR to mcedit
  2. start mc

3 start mcedit dummy.txt

$ mc -V
GNU Midnight Commander 4.8.32
Built with GLib 2.68.4
Built with S-Lang 2.3.2 with terminfo database
With builtin editor and aspell support
With optional subshell support
With support for background operations
With mouse support on xterm and Linux console
With internationalization support
With multiple codepages support
With ext2fs attributes support
Virtual File Systems:

cpiofs, tarfs, sfs, extfs, ftpfs, shell

Data types:

char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;

Change History

comment:1 Changed 3 months ago by zaytsev

So why do you open a separate ticket? This branch is not even merged to master.

If you need a workaround, apply my patch, I hope this works for you:

diff --git a/contrib/mc-wrapper.csh.in b/contrib/mc-wrapper.csh.in
index 1eca8e7b7..5fedb7aa6 100644
--- a/contrib/mc-wrapper.csh.in
+++ b/contrib/mc-wrapper.csh.in
@@ -1,9 +1,7 @@
-set MC_USER=`whoami`
-
 if ($?TMPDIR) then
-       setenv MC_PWD_FILE $TMPDIR/mc-$MC_USER/mc.pwd.$$
+       setenv MC_PWD_FILE `mktemp $MC_TMPDIR/mc.pwd.XXXXXX`
 else
-       setenv MC_PWD_FILE /tmp/mc-$MC_USER/mc.pwd.$$
+       setenv MC_PWD_FILE `mktemp /tmp/mc.pwd.XXXXXX`
 endif
 
 @bindir@/mc -P "$MC_PWD_FILE" $*
@@ -18,4 +16,3 @@ endif
 
 rm -f "$MC_PWD_FILE"
 unsetenv MC_PWD_FILE
-unsetenv MC_USER
diff --git a/contrib/mc-wrapper.sh.in b/contrib/mc-wrapper.sh.in
index 3905be480..bbf24bf8c 100644
--- a/contrib/mc-wrapper.sh.in
+++ b/contrib/mc-wrapper.sh.in
@@ -1,5 +1,6 @@
-MC_USER=`whoami`
-MC_PWD_FILE="${TMPDIR-/tmp}/mc-$MC_USER/mc.pwd.$$"
+MC_PWD_FILE=`mktemp ${MC_TMPDIR:-/tmp}/mc.pwd.XXXXXX` || exit 1
+trap 'rm -f -- "$MC_PWD_FILE"' INT TERM HUP EXIT
+
 @bindir@/mc -P "$MC_PWD_FILE" "$@"
 
 if test -r "$MC_PWD_FILE"; then
@@ -10,6 +11,4 @@ if test -r "$MC_PWD_FILE"; then
        unset MC_PWD
 fi
 
-rm -f "$MC_PWD_FILE"
 unset MC_PWD_FILE
-unset MC_USER

comment:2 Changed 3 months ago by zaytsev

  • Status changed from new to closed
  • Version master deleted
  • Resolution set to duplicate
  • Milestone Future Releases deleted

Closed as duplicate of #4575.

Note: See TracTickets for help on using tickets.