RE: Patch 7.1.262

2008-02-21 Fir de Conversatie [EMAIL PROTECTED]



 -Original Message-
 From: vim_dev@googlegroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Richard Hartmann
 Sent: 21 February 2008 00:09
 To: vim_dev@googlegroups.com
 Subject: Re: Patch 7.1.262
 
 
 On Wed, Feb 20, 2008 at 11:16 PM, Milan Vancura [EMAIL PROTECTED] wrote:
 
   Yes, it was Zdenek's original request...
 
 Come to think of it, get_ppname could be even more important than
 get_ppid.
 

I don't understand: PPID is available on every *[iu]x system
that I know of as $PPID, so what's to write for vim?
I needed PID, I haven't tried the patch but I'm sure that's
what it is providing.

PID never changes with the *running* process, as Tony says
in his email.

---Zdenek


--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



RE: Patch 7.1.262

2008-02-21 Fir de Conversatie Zdenek Sekera


 -Original Message-
 From: vim_dev@googlegroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Richard Hartmann
 Sent: 21 February 2008 02:24
 To: vim_dev@googlegroups.com
 Cc: [EMAIL PROTECTED]
 Subject: Re: Patch 7.1.262
 
 
 On Wed, Feb 20, 2008 at 11:17 PM, Ben Schmidt
 [EMAIL PROTECTED] wrote:
 
   But it's unique during the period that the Vim process is running,
 which is the
   only time the function can be called, and the only time the concept
 of a process
   ID really makes sense! I think 'unique' here didn't mean for all
 space and time!
 
 Of course. But being able to generate/query a value and to reliably use
 it as a
 unique value are vastly different. If in doubt, it's better to be
 precice.
 

Right, but every shell book explains what's $$ and when and how
it can be useful.

---Zdenek


smime.p7s
Description: S/MIME cryptographic signature


Re: Patch 7.1.262

2008-02-21 Fir de Conversatie Tony Mechelynck

[EMAIL PROTECTED] wrote:
 
 
 -Original Message-
 From: vim_dev@googlegroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Richard Hartmann
 Sent: 21 February 2008 00:09
 To: vim_dev@googlegroups.com
 Subject: Re: Patch 7.1.262


 On Wed, Feb 20, 2008 at 11:16 PM, Milan Vancura [EMAIL PROTECTED] wrote:
  Yes, it was Zdenek's original request...
 Come to think of it, get_ppname could be even more important than
 get_ppid.

 
 I don't understand: PPID is available on every *[iu]x system
 that I know of as $PPID, so what's to write for vim?
 I needed PID, I haven't tried the patch but I'm sure that's
 what it is providing.
 
 PID never changes with the *running* process, as Tony says
 in his email.
 
 ---Zdenek

Vim already used its PID, for instance in the swap files as shown in the 
|ATTENTION| message, so it was no big deal to make it available as a builtin 
function. Since patch 7.1.262, you can now get it as a Number, as the result 
of the getpid() function. Its help isn't yet available on the ftp/rsync 
servers (so if you applied the patch, sync'ing your runtimes will remove that 
help ยง) but I'm confident it soon will be.


Best regards,
Tony.
-- 
Duct tape is like the force.  It has a light side, and a dark side, and
it holds the universe together ...
-- Carl Zwanzig


--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Patch 7.1.262

2008-02-21 Fir de Conversatie Bram Moolenaar


Richard Hartmann wrote:

 On Wed, Feb 20, 2008 at 8:10 PM, Bram Moolenaar [EMAIL PROTECTED] wrote:
 
 
   + getpid()  Return a Number which is the process ID of the Vim process.
   +   On Unix this is a unique number.  On MS-DOS it's always 
  zero.
 
 At least on Linux, it's not a unique number. It isn't even unique during
 a single uptime, as the counter will roll over at 65534 and start
 re-using freed PIDs. Slightly different, but same principle for Linux
 systems with randomized PIDs.

I don't think there is any Unix-like system where two processes can have
the same number.  The numbers are recycled after a process exits, of
course.

 It might make sense to implement get_ppid() as well, even though I can't
 think of anything useful to do with that info. Perhaps check if you run
 in screen and warn if not? Dunno.

We don't usually add features just in case someone might use them some
day.

-- 
I wonder how much deeper the ocean would be without sponges.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Patch 7.1.262

2008-02-20 Fir de Conversatie Tony Mechelynck

Adri Verhoef wrote:
 On Wed, Feb 20, 2008 at 20:40:45 +0100, Richard Hartmann wrote:
 On Wed, Feb 20, 2008 at 8:10 PM, Bram Moolenaar [EMAIL PROTECTED] wrote:


  + getpid()  Return a Number which is the process ID of the Vim process.
  +   On Unix this is a unique number.  On MS-DOS it's always 
 zero.
 At least on Linux, it's not a unique number.
 
 You mean that it is not the process ID of the Vim process?
 
 Adri

No, what he meeans is: after a process exits, its PID may (usually not 
immediately) be reused for another process, started after the first one has 
exited. OTOH, on Linux the PID is unique in the sense that no two simultaneous 
processes can have the same PID.


Best regards,
Tony.
-- 
If you ever want to get anywhere in politics, my boy, you're going to
have to get a toehold in the public eye.

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Patch 7.1.262

2008-02-20 Fir de Conversatie Richard Hartmann

On Wed, Feb 20, 2008 at 11:16 PM, Milan Vancura [EMAIL PROTECTED] wrote:

  Yes, it was Zdenek's original request...

Come to think of it, get_ppname could be even more important than
get_ppid.


Bram: If you agree that this is useful, I can try my hands at a patch, so you
don't have to. It is prolly the best junior job I saw since joining
the VIM lists.


Richard

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Patch 7.1.262

2008-02-20 Fir de Conversatie George V. Reilly
On 20/02/2008, Richard Hartmann [EMAIL PROTECTED] wrote:


 On Wed, Feb 20, 2008 at 11:32 PM, Tony Mechelynck
 [EMAIL PROTECTED] wrote:

You mean that it is not the process ID of the Vim process?
 

   No, what he meeans is: after a process exits, its PID may (usually not
   immediately) be reused for another process, started after the first one
 has
   exited. OTOH, on Linux the PID is unique in the sense that no two
 simultaneous
   processes can have the same PID.


 Exactly. So if you were to create a permanent save file of whatever based
 on
 that number, you could lose data. Granted that it's unlikely, but
 clarification
 in the help file can't hurt.




The same caveats apply on Windows, which wasn't clear in Bram's help text.
-- 
/George V. Reilly
http://www.georgevreilly.com/blog

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Patch 7.1.262

2008-02-20 Fir de Conversatie Richard Hartmann

On Thu, Feb 21, 2008 at 12:21 AM, George V. Reilly [EMAIL PROTECTED] wrote:


 The same caveats apply on Windows, which wasn't clear in Bram's help text.

I assumed Bram counted Windows towards DOS, thus not offering a PID at all?


Richard

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Patch 7.1.262

2008-02-20 Fir de Conversatie Richard Hartmann

On Wed, Feb 20, 2008 at 11:17 PM, Ben Schmidt
[EMAIL PROTECTED] wrote:

  But it's unique during the period that the Vim process is running, which is 
 the
  only time the function can be called, and the only time the concept of a 
 process
  ID really makes sense! I think 'unique' here didn't mean for all space and 
 time!

Of course. But being able to generate/query a value and to reliably use it as a
unique value are vastly different. If in doubt, it's better to be precice.


Richard

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Patch 7.1.262

2008-02-20 Fir de Conversatie George V. Reilly
On 20/02/2008, Richard Hartmann [EMAIL PROTECTED] wrote:


 On Thu, Feb 21, 2008 at 12:21 AM, George V. Reilly [EMAIL PROTECTED]
 wrote:


  The same caveats apply on Windows, which wasn't clear in Bram's help
 text.


 I assumed Bram counted Windows towards DOS, thus not offering a PID at
 all?


I'm sure Bram knows better than that. 16-bit DOS has no form of
multitasking, so a PID would be meaningless. But even Win16 has multiple
processes.
-- 
/George V. Reilly
http://www.georgevreilly.com/blog

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Patch 7.1.262

2008-02-20 Fir de Conversatie Ben Schmidt

 I assumed Bram counted Windows towards DOS, thus not offering a PID at all?

No, Windows does have PID's, supported by the new Vim getpid() function. I 
agree 
the docs are unclear on this. Would be better if they had 'Unix and Windows'.

Ben.





Send instant messages to your online friends http://au.messenger.yahoo.com 


--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Patch 7.1.262

2008-02-20 Fir de Conversatie Ben Schmidt

 Of course. But being able to generate/query a value and to reliably use it as 
 a
 unique value are vastly different.

I think you *can* reliably use it as a unique value (though only within the 
context of the process running), so I don't think these are vastly different. I 
personally think adding such an explanation to the docs would just add noise.

 If in doubt, it's better to be precice.

LOL. Was that deliberate?! 'Precise.'

Smiles,

Ben.



Send instant messages to your online friends http://au.messenger.yahoo.com 


--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---