Re: max filesize split(1)

2006-10-20 Thread Sebastian Dehne
 yes, but then it's still irrelevant how big a file the source
 filesystem supports, which was the original question.

The filesystem reference in my original question was meant as an
example. My point was just that split(1) could need an upgrade since it is
not too uncommon anymore to split files which are bigger than 2GB.
That's all. Now, let's skip the fs talk.

regards
Sebastian



Re: max filesize split(1)

2006-10-19 Thread Shawn K. Quinn
On Tue, 2006-10-17 at 10:39 -0700, Ted Unangst wrote:
 On 10/17/06, Otto Moerbeek [EMAIL PROTECTED] wrote:
  There is no uniform way to ask the max file size of a given
  file system. ffs filestems do have that info in therir superblock,
  though, you can see it with dumpfs(8).
 
 it hardly matters.  if the file is on the filesystem, the filesystem
 supports files of that size.

Isn't it possible, though, to split a file on one filesystem, writing
the pieces to another filesystem with a smaller maximum file size?

-- 
Shawn K. Quinn [EMAIL PROTECTED]



Re: max filesize split(1)

2006-10-19 Thread Ted Unangst

On 10/19/06, Shawn K. Quinn [EMAIL PROTECTED] wrote:

On Tue, 2006-10-17 at 10:39 -0700, Ted Unangst wrote:
 On 10/17/06, Otto Moerbeek [EMAIL PROTECTED] wrote:
  There is no uniform way to ask the max file size of a given
  file system. ffs filestems do have that info in therir superblock,
  though, you can see it with dumpfs(8).

 it hardly matters.  if the file is on the filesystem, the filesystem
 supports files of that size.

Isn't it possible, though, to split a file on one filesystem, writing
the pieces to another filesystem with a smaller maximum file size?


yes, but then it's still irrelevant how big a file the source
filesystem supports, which was the original question.

it either works or it doesn't.  does cp check max file size?  does
tar?  does scp?  ftp?  firefox?  mplayer?  vi?  split is not that
special.



Re: max filesize split(1)

2006-10-17 Thread Otto Moerbeek
On Mon, 16 Oct 2006, Sebastian Dehne wrote:

 Replacing the long data type with a bigger type, so that split(1)
 supports bigger splits, works good enough for me.

Don't make it harder that needed. If you have a tested diff, send it in.

-Otto



Re: max filesize split(1)

2006-10-17 Thread Otto Moerbeek
On Mon, 16 Oct 2006, Sebastian Dehne wrote:

 Hi,
 
 I noticed that split(1) can only handle files which's size = 2GB. I
 adjusted my version so that it support larger files.
 
 Why is this limit never increased. I mean, the fs supports much bigger
 files. Are there any plans to increased this limit in the future so I 
 don't need to patch again when installing a new release?

send a diff and we will consider it.

-Otto



Re: max filesize split(1)

2006-10-17 Thread Chris Kuethe

The following diff works on my amd64. I split an 8GB file into two
chunks: 5GB and 3GB

Index: split.c
===
RCS file: /cvs/src/usr.bin/split/split.c,v
retrieving revision 1.13
diff -u -r1.13 split.c
--- split.c 2006/08/10 22:44:17 1.13
+++ split.c 2006/10/17 07:23:15
@@ -60,7 +60,7 @@

#define DEFLINE 1000/* Default num lines per file. */

-ssize_t bytecnt;   /* Byte count to split on. */
+off_t   bytecnt;   /* Byte count to split on. */
long numlines;  /* Line count to split on. */
int  file_open; /* If a file open. */
int  ifd = -1, ofd = -1;/* Input/output file descriptors. */

On 10/17/06, Otto Moerbeek [EMAIL PROTECTED] wrote:

On Mon, 16 Oct 2006, Sebastian Dehne wrote:

 Hi,

 I noticed that split(1) can only handle files which's size = 2GB. I
 adjusted my version so that it support larger files.

 Why is this limit never increased. I mean, the fs supports much bigger
 files. Are there any plans to increased this limit in the future so I
 don't need to patch again when installing a new release?

send a diff and we will consider it.

-Otto





--
GDB has a 'break' feature; why doesn't it have 'fix' too?



Re: max filesize split(1)

2006-10-17 Thread Sebastian Dehne
Otto,

Thanks for considering it. Here is the patch which worked for me:

#
# BEGIN PATCH SPLIT(1)
#
--- split.c Tue Oct 17 09:19:24 2006
+++ split_new.c Tue Oct 17 09:20:15 2006
@@ -59,7 +59,7 @@

 #define DEFLINE1000/* Default num lines per
file. */

-longbytecnt;   /* Byte count to split on. */
+long long   bytecnt;   /* Byte count to split
on. */
 longnumlines;  /* Line count to split on. */
 int file_open; /* If a file open. */
 int ifd = -1, ofd = -1;/* Input/output file
descriptors. */
@@ -105,7 +105,7 @@
ifd = 0;
break;
case 'b':   /* Byte count. */
-   if ((bytecnt = strtol(optarg, ep, 10)) = 0 ||
+   if ((bytecnt = strtoll(optarg, ep, 10)) = 0 ||
(*ep != '\0'  *ep != 'k'  *ep != 'm'))
errx(EX_USAGE,
%s: illegal byte count, optarg);
@@ -171,7 +171,7 @@
 void
 split1(void)
 {
-   long bcnt;
+   long long bcnt;
int dist, len;
char *C;
#
# END PATCH SPLIT(1)
#



Otto Moerbeek ([EMAIL PROTECTED]) wrote:
 
 send a diff and we will consider it.
 
   -Otto



Re: max filesize split(1)

2006-10-17 Thread Otto Moerbeek
On Mon, 16 Oct 2006, ICMan wrote:

 My $0.02:
 
 Is there a way to query the file system to find out what the max-file-size is?
 If there is, I don't know how to do it, but it could be added to split(1) so
 that split(1) will handle the largest file allowed by whichever file system is
 holding the file it is pointing to.

I think it is enough to make split handle file sizes up to the max of
off_t. Any actual maximum file size will be smaller of equal to that.

There is no uniform way to ask the max file size of a given
file system. ffs filestems do have that info in therir superblock,
though, you can see it with dumpfs(8).

nfsv3 also use this info, it is exchanged when a mount is done.
tcpdump is able to show it. 

-Otto

 
 ICMan
 
 Sebastian Dehne wrote:
 
  Hi,
  
  I noticed that split(1) can only handle files which's size = 2GB. I
  adjusted my version so that it support larger files.
  
  Why is this limit never increased. I mean, the fs supports much bigger
  files. Are there any plans to increased this limit in the future so I don't
  need to patch again when installing a new release?
  
  regards,
  
  Sebastian



Re: max filesize split(1)

2006-10-17 Thread Otto Moerbeek
On Tue, 17 Oct 2006, Sebastian Dehne wrote:

 Otto,
 
 Thanks for considering it. Here is the patch which worked for me:

This is not enough at least the call to strtol() in the -b case
and the limit check needs to be fixed as well. ckuethe@ is working on
something. 

-Otto

 
 #
 # BEGIN PATCH SPLIT(1)
 #
 --- split.c Tue Oct 17 09:19:24 2006
 +++ split_new.c Tue Oct 17 09:20:15 2006
 @@ -59,7 +59,7 @@
 
  #define DEFLINE1000/* Default num lines per
 file. */
 
 -longbytecnt;   /* Byte count to split on. */
 +long long   bytecnt;   /* Byte count to split
 on. */
  longnumlines;  /* Line count to split on. */
  int file_open; /* If a file open. */
  int ifd = -1, ofd = -1;/* Input/output file
 descriptors. */
 @@ -105,7 +105,7 @@
 ifd = 0;
 break;
 case 'b':   /* Byte count. */
 -   if ((bytecnt = strtol(optarg, ep, 10)) = 0 ||
 +   if ((bytecnt = strtoll(optarg, ep, 10)) = 0 ||
 (*ep != '\0'  *ep != 'k'  *ep != 'm'))
 errx(EX_USAGE,
 %s: illegal byte count, optarg);
 @@ -171,7 +171,7 @@
  void
  split1(void)
  {
 -   long bcnt;
 +   long long bcnt;
 int dist, len;
 char *C;
 #
 # END PATCH SPLIT(1)
 #
 
 
 
 Otto Moerbeek ([EMAIL PROTECTED]) wrote:
  
  send a diff and we will consider it.
  
  -Otto



Re: max filesize split(1)

2006-10-17 Thread Ted Unangst

On 10/17/06, Otto Moerbeek [EMAIL PROTECTED] wrote:

There is no uniform way to ask the max file size of a given
file system. ffs filestems do have that info in therir superblock,
though, you can see it with dumpfs(8).


it hardly matters.  if the file is on the filesystem, the filesystem
supports files of that size.



Re: max filesize split(1)

2006-10-17 Thread Otto Moerbeek
On Tue, 17 Oct 2006, Ted Unangst wrote:

 On 10/17/06, Otto Moerbeek [EMAIL PROTECTED] wrote:
  There is no uniform way to ask the max file size of a given
  file system. ffs filestems do have that info in therir superblock,
  though, you can see it with dumpfs(8).
 
 it hardly matters.  if the file is on the filesystem, the filesystem
 supports files of that size.

yes, that's why i said being able to handle files up to the max of
off_t should cover all cases.

-Otto



max filesize split(1)

2006-10-16 Thread Sebastian Dehne
Hi,

I noticed that split(1) can only handle files which's size = 2GB. I
adjusted my version so that it support larger files.

Why is this limit never increased. I mean, the fs supports much bigger
files. Are there any plans to increased this limit in the future so I 
don't need to patch again when installing a new release?

regards,

Sebastian



Re: max filesize split(1)

2006-10-16 Thread Nico Meijer
Hi Sebastian,

 Why is this limit never increased. I mean, the fs supports much bigger
 files. Are there any plans to increased this limit in the future so I 
 don't need to patch again when installing a new release?

Have you tried sending a diff?

HTH and thanks... Nico :-)



Re: max filesize split(1)

2006-10-16 Thread ICMan

My $0.02:

Is there a way to query the file system to find out what the 
max-file-size is?  If there is, I don't know how to do it, but it could 
be added to split(1) so that split(1) will handle the largest file 
allowed by whichever file system is holding the file it is pointing to.


ICMan

Sebastian Dehne wrote:


Hi,

I noticed that split(1) can only handle files which's size = 2GB. I
adjusted my version so that it support larger files.

Why is this limit never increased. I mean, the fs supports much bigger
files. Are there any plans to increased this limit in the future so I 
don't need to patch again when installing a new release?


regards,

Sebastian




Re: max filesize split(1)

2006-10-16 Thread Sebastian Dehne
Replacing the long data type with a bigger type, so that split(1)
supports bigger splits, works good enough for me.

Sebastian

ICMan ([EMAIL PROTECTED]) wrote:
 My $0.02:
 
 Is there a way to query the file system to find out what the 
 max-file-size is?  If there is, I don't know how to do it, but it could 
 be added to split(1) so that split(1) will handle the largest file 
 allowed by whichever file system is holding the file it is pointing to.
 
 ICMan