Sponsored Content
Top Forums UNIX for Beginners Questions & Answers How to check if a file is open in editor? Post 303005378 by RudiC on Tuesday 17th of October 2017 01:24:02 PM
Old 10-17-2017
Not quite clear what exactly you are doing there; please give more info. Using leafpad to open / edit a file:
Code:
pgrep -xf "leafpad file1"; echo $?
6200
0
pgrep -xf "leafpad file1"; echo $?
1

First is with open file, second after closing it.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Unable to open files in VI editor

Hi, I unable to open any file using Vi editor,constantly getting the following error, vi log.log *** glibc detected *** malloc(): memory corruption: 0x081af510 ** uname -a Linux sekac092 2.6.5-7.244-bigsmp #1 SMP Mon Dec 12 18:32:25 UTC 2005 i686 athlon i386 GNU/Linux Also Note ls... (8 Replies)
Discussion started by: ennstate
8 Replies

2. Shell Programming and Scripting

How to give permissions to an open file in vi editor?

Hi all, I have a shell script that i started editing, only in the midst of which i tried to save the changes i found that the file wasnt been provided with write/execute permissions. I later have redone the changes and saved the file- Just curious to know if there was any command wherein... (5 Replies)
Discussion started by: Pankajakshan
5 Replies

3. UNIX for Advanced & Expert Users

getting error when open vi editor

helo I install my product for koren language I m uisng RHEL -4 operating system now problem is whenever I open any file vi filename I got following error on the screen E557: Cannot open termcap file 'vt100' not known. Available builtin terminals are: builtin_ansi ... (1 Reply)
Discussion started by: amitpansuria
1 Replies

4. UNIX for Dummies Questions & Answers

How to open file in VI Editor at a specific line?

i have following query e.g i want the VI Editor cursor at line number N instead of 0 while opening the file from unix prompt. vi filename ?????? Can anyone help? (4 Replies)
Discussion started by: skyineyes
4 Replies

5. Shell Programming and Scripting

avoid open file to check field.

Hi Everyone, # cat a.txt 94,aqqc,62345907, 5,aeec,77, # cat 1.pl #!/usr/bin/perl use strict; use warnings; use Date::Manip; open(my $FA, "/root/a.txt") or die "$!"; while(<$FA>) { chomp; my @tmp=split(/\,/, $_); if (index($tmp, "qq") ne -1) { ... (4 Replies)
Discussion started by: jimmy_y
4 Replies

6. Solaris

Before I delete any file in Unix, How can I check no open file handle is pointing to that file?

I know how to check if any file has a unix process using a file by looking at 'lsof <fullpath/filename>' command. I think using lsof is very expensive. Also to make it accurate we need to inlcude fullpath of the file. Is there another command that can tell if a file has a truely active... (12 Replies)
Discussion started by: kchinnam
12 Replies

7. UNIX and Linux Applications

Notepad++ hang when open file edited in other text editor

Hi, I would like to ask about the notepad++ text editor application, Although there are alternative and more great text editor in linux (gedit, geany, jedit) im still using the notepad++ sometimes cause for some of my own reason one of those is the minimalist text(what i mean is notepad++ has a... (2 Replies)
Discussion started by: jao_madn
2 Replies

8. UNIX for Dummies Questions & Answers

Vi editor will not open new to UNIX. help please.

vi: syntax error at line 1: `)' unexpected when I try to vi into the /etc/vfstab, the return gives me the above error. how can resolve this so that I can have access into vi. (6 Replies)
Discussion started by: dovestar
6 Replies

9. Shell Programming and Scripting

Not able to read .csv file until open in vi editor

Hi, I am facing a problem regarding .csv file, my script does not read .csv file and if i open this file in vi editor and perform :wq option then only my script reads the .csv file. Thanks (5 Replies)
Discussion started by: ranabhavish
5 Replies

10. Shell Programming and Scripting

To check if a file is open and in use (logs are being written to it)

Hello Experts, I need to write a shell script to check if a file is open and something is being written to it. I want to know how OS handles it. I checked with lsof command but it is not working. For a test I did this. while true; do echo `date` >>abc.txt; done then I checked lsof |... (5 Replies)
Discussion started by: shekhar_4_u
5 Replies
SVN::Simple::Edit(3)					User Contributed Perl Documentation				      SVN::Simple::Edit(3)

NAME
SVN::Simple::Edit - A simple interface for driving svn delta editors SYNOPSIS
my $edit = SVN::Simple::Edit->new (_editor => [SVN::Repos::get_commit_editor($repos, "file://$repospath", '/', 'root', 'FOO', &committed)], ); $edit->open_root($fs->youngest_rev); $edit->add_directory ('trunk'); $edit->add_file ('trunk/filea'); $edit->modify_file ("trunk/fileb", "content", $checksum); $edit->delete_entry ("trunk/filec"); $edit->close_edit (); ... $edit->copy_directory ('branches/a, trunk, 0); DESCRIPTION
SVN::Simple::Edit wraps the subversion delta editor with a perl friendly interface and then you could easily drive it for describing changes to a tree. A common usage is to wrap the commit editor, so you could make commits to a subversion repository easily. This also means you can not supply the $edit object as an delta_editor to other API, and that's why this module is named ::Edit instead of ::Editor. See SVN::Simple::Editor for simple interface implementing a delta editor. PARAMETERS
for constructor _editor The editor that will receive delta editor calls. missing_handler Called when parent directory are not opened yet, could be: &SVN::Simple::Edit::build_missing Always build parents if you don't open them explicitly. &SVN::Simple::Edit::open_missing Always open the parents if you don't create them explicitly. SVN::Simple::Edit::check_missing ([$root]) Check if the path exists on $root. Open it if so, otherwise create it. root The default root to use by SVN::Simple::Edit::check_missing. base_path The base path the edit object is created to send delta editor calls. noclose Do not close files or directories. This might make non-sorted operations on directories/files work. METHODS
Note: Don't expect all editors will work with operations not sorted in DFS order. open_root ($base_rev) add_directory ($path) open_directory ($path) copy_directory ($path, $from, $fromrev) add_file ($path) open_file ($path) copy_file ($path, $from, $fromrev) delete_entry ($path) change_dir_prop ($path, $propname, $propvalue) change_file_prop ($path, $propname, $propvalue) close_edit () AUTHORS
Chia-liang Kao <clkao@clkao.org> COPYRIGHT
Copyright 2003-2004 by Chia-liang Kao <clkao@clkao.org>. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See <http://www.perl.com/perl/misc/Artistic.html> perl v5.12.1 2005-02-23 SVN::Simple::Edit(3)
All times are GMT -4. The time now is 12:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy