vi editor swap file please help


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers vi editor swap file please help
# 1  
Old 09-14-2010
vi editor swap file please help

Hi,
when using vi editor, why do i automatically create swap file. this is very hard on me as on some systems i do not have remove file permission and swap file is only readable. it always happens to me, regardless of the computer i am using. does not happen to my classmates. i don't even know the procedure to create a swap file.
in the future, how can i prevent creating swap files when writing or editing a file using a vi editor?
any help will be appreciated.

---------- Post updated at 03:24 PM ---------- Previous update was at 02:59 PM ----------

this is not specifically a classroom or a homework problem so plz do not close it.
it is a general problem i wish to resolve whenever i use the vi editor.
thanks.
# 2  
Old 09-14-2010
vi uses /var/tmp for storing temporary versions of the file you edit. This is what you probably mean instead of a swap file.

I think you have your file mask set incorrectly. Unless you specified the directory command in your .exrc file - in your home directory. Assuming you have not tired to write the tmp files someplace odd by accident:
Code:
umask 002

is what you want.

To see your current umask
Code:
umask

The output for this should be 02 -- when it is set correctly.
This User Gave Thanks to jim mcnamara For This Post:
# 3  
Old 09-14-2010
I'd find it very unusual that you'd be able to create a file, but not remove it. Ask your system administrator about it, it might be a misconfiguration of ACLs or the like.

With vi, you can't disable it AFAIK (although I'm not sure that vi even creates swap files). With vim you can either disable it by running it as vim -n file (for a single instance), by adding set noswapfile in your ~/.vimrc (permanent), or by setting a fixed path for the swap file by adding set dir=/tmp to always create it in /tmp.
This User Gave Thanks to pludi For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to swap to words in a file?

Hi, I have a file with certain lines in it. i want to swap every occurance of word A with B and every occurrance of word B with A. Example file.txt Unix is a great OS. Linux support graphical user intrface. unix and linux are both same. Output file.txt Linux is a great OS. Unix... (5 Replies)
Discussion started by: Little
5 Replies

2. Solaris

Explain the output of swap -s and swap -l

Hi Solaris Folks :), I need to calculate the swap usage on solaris server, please let me understand the output of below swap -s and swap -l commands. $swap -s total: 1774912k bytes allocated + 240616k reserved = 2015528k used, 14542512k available $swap -l swapfile dev swaplo... (6 Replies)
Discussion started by: seenuvasan1985
6 Replies

3. HP-UX

Swap device file and swap sapce

Hi I have an integrity machine rx7620 and rx8640 running hp-ux 11.31. I'm planning to fine tune the system: - I would like to know when does the memory swap space spill over to the device swap space? - And how much % of memory swap utilization should be specified (swap space device... (6 Replies)
Discussion started by: lamoul
6 Replies

4. UNIX for Dummies Questions & Answers

swap fields in a file

I have a file (tmp.out) with contents delimited by '|': 1|d|2|rt| 3|sfd|4|sgf| 5|sg|6|gtr| 7|s|8|sf| I want to write only the 1st and 3rd columns to another file, but they should be swapped with each other: 2|1 4|3 6|5 8|7 Here is what I have so far: ... (2 Replies)
Discussion started by: ChicagoBlues
2 Replies

5. Shell Programming and Scripting

set EDITOR=vi -> default editor not setting for cron tab

Hi All, I am running a script , working very fine on cmd prompt. The problem is that when I open do crontab -e even after setting editor to vi by set EDITOR=vi it does not open a vi editor , rather it do as below..... ///////////////////////////////////////////////////// $ set... (6 Replies)
Discussion started by: aarora_98
6 Replies

6. Solaris

Swap config - Mirror swap or not?

Hello and thanks in advance. I have a Sun box with raid 1 on the O/S disks using solaris svm. I want to unmirror my swap partition, and add the slice on the second disk as an additional swap device. This would give me twice as much swap space. I have been warned not to do this by some... (3 Replies)
Discussion started by: BG_JrAdmin
3 Replies

7. Solaris

swap file not present

Hello all, We are running a 2 gig Solaris10 system. The only application that's running on the system is ours which allocates 850MB through malloc at one shot. For some reason this malloc keeps failing saying "Resource Temporarily Unavilable" After some investigation, found that it goes... (7 Replies)
Discussion started by: Naanu
7 Replies

8. UNIX for Dummies Questions & Answers

File name swap

I'm trying to write a shell script that accepts two file extensions as command line arguments and renames all files with the first extension within the current working directory to have the second extension instead. The script should print out error messages as is appropriate if there is any... (1 Reply)
Discussion started by: asianmike
1 Replies

9. UNIX for Advanced & Expert Users

RAID 1 on SWAP file?

Hey everyone, first of all, this is the motherboard I have: GigaByte GA-K8NXP-9 , nForce4 Ultra. It supports RAID 0, 1, 0+1 apparently both on the IDE and S-ATA HDD. Now what I had in mind is popping 2 x 6Gb HDD in the IDE slots as slave 1 & 2 where my 2 DVD/CD burners are master. I then plan... (2 Replies)
Discussion started by: temba
2 Replies

10. UNIX for Dummies Questions & Answers

Swap file

I just started working with AIX and need a little help. Is there a command to find the size of the swap file. (1 Reply)
Discussion started by: paule
1 Replies
Login or Register to Ask a Question