Monday, April 23, 2012

GpDelphiUnits update

As always, all units are available on Google Code.

DSiWin32 1.66

  • Implemented DSiSetFileTime and DSiSetFileTimes.
  • Implemented DSiDateTimeToFileTime.
  • TDSiRegistry.ReadBinary, WriteBinary now use RawByteString for data buffer.

GpHugeF 6.05

  • Added logging to TGpHugeFile[Stream].

GpStreams 1.39

  • Added function CopyStreamEx accepting a TStreamProgressEvent.

GpStringHash 1.11

  • TGpStringObjectHash.Find returns 'nil' in 'value' parameter if key is not found.

GpTextStream 1.10

  • Implemented TGpTextMemoryStream, a TGpTextStream wrapped around a TMemoryStream.

19 comments:

  1. Anonymous13:36

    Aren't this omnixml units?

    Is this a fork (or the original?)

    ReplyDelete
  2. No, this is the original. OmniXML uses a copy of some of those units. As does OmniThreadLibrary.

    ReplyDelete
    Replies
    1. terry04:36

      Are those, and will them be compatible with eachother? I mean, both OXML and OTL uses rather old versions of the Gp units.

      Delete
    2. Yes, they will be compatible. OTL is typically quite in sync with the GpDelphiUnits repo while OmniXML indeed laps behind but I always make sure that OmniXML works with the current version of the units too.

      Delete
  3. Anonymous14:20

    Check the links, please (they refer to localhost)

    ReplyDelete
    Replies
    1. Fixed, thanks for the warning.

      Delete
  4. Anonymous17:32

    Hi,

    thank you for everything! But please, could you help me set DSiExecuteAndCapture so that it will wait a custom time for the application to close, otherwise will force the exit with an error?

    ReplyDelete
    Replies
    1. DSiExecuteAndCapture has waitTimeout_sec parameter which does what you want.

      Delete
    2. Anonymous18:06

      i tried it i have a simple bat like:

      echo "hi"
      pause

      then i called:

      NumHdl := DSiExecuteAndCapture(BatPath, TmpSl, '', CodErr, 60);

      but it does not wait. it should wait because of "pause" shouldn't it?

      Delete
    3. Anonymous12:02

      Please can you tell me something about it? That function is great and I need it so much, but I need it to stop and wait for the bat.
      Is there a bug or is it me that I'm doing something wrong?

      Delete
    4. Yes, I'll look into it. As soon as I find some time.

      Delete
    5. Anonymous13:55

      thanks! that would help me so much!

      Delete
    6. It is because the 'pause' doesn't really pause when you execute your batch in a hidden window. Command line processor is too smart.

      Replace it with

      for /l %i in (1, 1, 100) do sleep 1

      and you'll get the timeout.

      Delete
    7. Anonymous11:22

      Hi, there's still something wrong...
      I tried another thing, a BAT that runs Notepad. It should wait until i close notepad.

      I don't know why but sometimes it returns all kind of error exitcode.

      Can you double check please?

      try this:

      1) debug this:
      Error := DSiExecuteAndCapture('a.bat', slerrori, '', ExitCode, 60);

      2) the first time it should wait, but terminate the program (CTRL-F2)

      3) try it again, it will not wait anymore and it will send you all kind of errors.

      Any Idea?

      Delete
    8. Works fine here.

      Delete
    9. Anonymous11:42

      true, you are right. i found the problem, the problem appears when it can't find the BAT, it starts returning wrong error codes.

      I had the bat in the wrong folder. looks like it's working now.

      Think you can fix the message if the file is not found ?

      Delete
  5. Anonymous18:13

    also, the link lets me download version 1.64a not 1.66

    ReplyDelete
  6. Anonymous09:48

    Hi,
    thank you so much for this great library!!

    I just have 1 question, regarding the function DSiExecuteAndCapture.

    Is it possible to increase buffer size to more than 1 MB?

    Is there a reason of 1Mb or can i use whatever I want? I often receive the error of Buffer FULL....

    thank you so much!!

    ReplyDelete