#8 nc -wait

closed-accepted
Arne F�rlie
None
5
2002-09-20
2001-02-06
Arne F�rlie
No

Reimplementation of feature from the MV version.
* Added -wait option to nc that causes nc to wait for the file or files listed to be closed.
* Added -openwait option to nc that causes nc to wait for the file or files listed to be opened.

Discussion

  • Arne F�rlie
    Arne F�rlie
    2001-02-06

    None

     
    Attachments
  • Scott Tringali
    Scott Tringali
    2001-03-25

    Logged In: YES
    user_id=11321

    Last I remember, Arne and Mark were working on some
    performance improvements. The changes were to reduce the
    number and size of server properties.

    I think this patch is a great idea and hope it is a reality
    in 5.2 (though I have no idea in the world why I would want
    to use -openwait).

    Arne, for some reason, I can't assign things to you (another
    SF bug?), so I'm assiging this to Mark temporarily.

     
  • Scott Tringali
    Scott Tringali
    2001-03-25

    • assigned_to: nobody --> edel
     
  • Arne F�rlie
    Arne F�rlie
    2001-04-16

    Logged In: YES
    user_id=75224

    The
    status is:
    - removed the -openwait feature
    - that allowed me simplify and reduce the usage of fileOpen
    properties,
    so that such properties now only exist for files opened with
    the -wait
    option.
    - in addition, to further avoid the buildup of properties
    from crashed
    (or killed) servers, I now delete all fileOpen properties
    that match
    host, user, servername when a new server must be started.
    The drawback to this is that it makes it slower to start
    a new server
    because nc must fetch the names of all properties and
    perform strcmp()
    on them. On my machine I have approx. 50 properties at any
    time so I
    consider the delay negligible.

    - However, I havn't been able to fix the use of timeouts in
    nc.c. I'm
    still relying on 'random' events to trigger timeouts,
    something Mark
    objected to.
    I would appreciate it anyone with more X experience to take
    a look at
    nc.c and see if it is possible to make this code better.

     
  • Arne F�rlie
    Arne F�rlie
    2001-04-16

     
    Attachments
  • Arne F�rlie
    Arne F�rlie
    2001-11-18

    Logged In: YES
    user_id=75224

    It has been pointed out that the -openwait feature is needed
    to integrate NEdit with tools that spawn editors. They tend
    to open editors on temp files, and attempt to clean them up
    quickly, which opens a small race in which it could delete
    the file before nedit opens it.

    I will therefore attempt to reintroduce this feature, but
    make it the _default_, instead of something you have to
    explicitly request via a command line switch.

     
  • Arne F�rlie
    Arne F�rlie
    2002-03-03

    Logged In: YES
    user_id=75224

    nc will now always wait until all files on the command line
    are opened. i.e. the previous -openwait switch is now
    default. However, there is no -noopenwait switch.
    The -wait switch works as in previous versions of this
    patch.

    Two sets of properties are now used, one for files that are
    in the process of being opened, another for files that have
    been opened with the -wait switch. That simplified the code
    a lot, and reduced the life-span of properties.
    In addition, I found a way where I just create an atom, but
    don't give it a value until the very last minute of its
    lifetime. Thereby properties don't get left behind in the
    root window in case of a crash (they don't show up with a
    xprop -root | grep NEDIT). However, I don't know if this is
    a general solution, or whether it just works by coinsidence
    on Linux (with LessTif)

    As before, the timeouts in nc.c still rely on 'random'
    events to trigger, and I still would appreciate it if
    someone with better X knowledge than myself could inmprove
    on that. The main() function in nc.c had grown very large,
    so it has now been split into a number of smaller functions.

    So far it has only been tested on LInux.

     
  • Arne F�rlie
    Arne F�rlie
    2002-03-03

    nc -wait patch v.3

     
    Attachments
  • Arne F�rlie
    Arne F�rlie
    2002-03-03

    • assigned_to: edel --> arnef
     
  • Arne F�rlie
    Arne F�rlie
    2002-03-09

    Logged In: YES
    user_id=75224

    For your information, my latest patch (v.3) contains a
    couple of bugs. nc doesn't exist if you try to open
    non-existing files with -wait and press 'Exit NEdit' or
    'Cancel' in the dialog.

    I'm working on a fix for this.

     
  • Arne F�rlie
    Arne F�rlie
    2002-08-15

    v. 4.0 against CVS HEAD of 15 AUG 2002

     
    Attachments
  • Arne F�rlie
    Arne F�rlie
    2002-08-15

    Logged In: YES
    user_id=75224

    Version 4 is a patch against CVS HEAD as of 15 AUG 2002.
    Give it a try and report if you find anything wrong.
    (I'll be on travel for about two weeks so don't expect any
    answers during that period.)

     
  • Eddy De Greef
    Eddy De Greef
    2002-09-20

    Logged In: YES
    user_id=73597

    In cvs now -> closed.

     
  • Eddy De Greef
    Eddy De Greef
    2002-09-20

    • status: open --> closed-accepted