PxPlus User Forum

Main Board => Discussions => Language => Topic started by: James Zukowski on January 27, 2023, 05:17:39 PM

Title: Detecting Multi-Segment Split File
Post by: James Zukowski 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!
Title: Re: Detecting Multi-Segment Split File
Post by: Loren Doornek 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
Title: Re: Detecting Multi-Segment Split File
Post by: James Zukowski 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.
Title: Re: Detecting Multi-Segment Split File
Post by: Mike King 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.
Title: Re: Detecting Multi-Segment Split File
Post by: James Zukowski 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.