PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Detecting Multi-Segment Split File  (Read 1453 times)

James Zukowski

  • Diamond Member
  • *****
  • Posts: 308
    • View Profile
Detecting Multi-Segment Split File
« on: January 27, 2023, 05:17:39 PM »
Is there a way to determine if a file is a multi-segment split file? We've got embedded io routines that do additional work based on a file's name. We're looking at splitting some of our larger files.
We would like to be able to parse out the base filename only, rather than have the full path and segment ID included. Being able to determine when to do the additional parsing work would certainly help.
Thanks!
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services

Loren Doornek

  • Gold Member
  • ****
  • Posts: 85
    • View Profile
Re: Detecting Multi-Segment Split File
« Reply #1 on: January 27, 2023, 06:34:53 PM »
You can get the number of segments from the file header, as long as it's not an EFF file.

OPEN INPUT(1,ISZ=1)"MY_FILE";READ RECORD(1,SIZ=256)R$;CLOSE(1)
SEGMENTS=DEC($00$+MID(R$,249,1))
PRINT SEGMENTS

James Zukowski

  • Diamond Member
  • *****
  • Posts: 308
    • View Profile
Re: Detecting Multi-Segment Split File
« Reply #2 on: February 02, 2023, 05:08:40 PM »
Thanks, but i don't know if that will help us...
Is there a way to determine if a file is a segment in a segmented file? That's what's being provided by the fin(lfa,"Filename") to our embedded io routine. We only need the base filename, not the actual segment name.
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services

Mike King

  • Diamond Member
  • *****
  • Posts: 3818
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Detecting Multi-Segment Split File
« Reply #3 on: February 03, 2023, 10:40:44 AM »
James

What exactly are you looking for? 

Are you try to use multi-segment files to extend the maximum file size beyond 2GB while keeping all segment under the 2GB so older file systems can support the files.

Or are you looking to use the file splitting functionality that will allow you control which data goes to different files.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

James Zukowski

  • Diamond Member
  • *****
  • Posts: 308
    • View Profile
Re: Detecting Multi-Segment Split File
« Reply #4 on: February 06, 2023, 08:36:54 AM »
We're looking to segment the data by date, so the historical data doesn't need to be backed up all the time. We have existing embedded io routines that apply new data writes to other related files that are used for exporting to and updating other systems. These are defined by the base file name, not the segment's name.
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services