Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to disable temporary and recovery files? #64

Open
liweitianux opened this issue Jun 25, 2019 · 3 comments
Open

How to disable temporary and recovery files? #64

liweitianux opened this issue Jun 25, 2019 · 3 comments

Comments

@liweitianux
Copy link

Hi.

Sometimes, one may be forced to work with a read-only root filesystem, like the rescue mode mentioned in issue #63. However, I cannot find an easy way to tell nvi2 to not create temporary and recovery files. I've tried the followings:

  • nvi -F <file>
  • nvi -c 'set dir=""' <file>

but with no luck... A workaround is to use something like TMPDIR=<writable-directory> nvi <file>. Is there a simpler/cleaner way to deal with this issue? Maybe options to disable temporary file or recovery file or both?

Regards,
Aaron

@lichray
Copy link
Owner

lichray commented Jun 25, 2019

You will need to set both "directory" and "recdir" (for recovery files).

@liweitianux
Copy link
Author

Thank you for the prompt reply.

However, I still have the same issue. I've tried the following usages:

  • nvi -c 'set directory="" recdir=""' <file>
  • nvi -c 'unset directory recdir' <file>

The error messages are:

Error: /var/tmp/vi.recover/: Read-only file system
Modifications not recoverable if the session fails
Error: <file>: Read-only file system
Error: Unable to create temporary file: Read-only file system

Were my usages wrong? Could you please suggest a clearer usage? Thanks.

(I'll try it more tomorrow night.)

Regards,
Aaron

@zhihaoy
Copy link

zhihaoy commented Jun 25, 2019

Rereading you issue, your workaround seems to be correct; I did not mean for disabling TMPDIR. The recdir can be disabled, but there has to be some TMPDIR, because nvi2 (and all nvi variants) need a file system fd to put Berkeley DB file. Does env TMPDIR=. work? If you feel that's still not automatic enough, then we can add some fallback when / is readonly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants