ObjFW  Diff

Differences From Artifact [ffd2b8da5e]:

To Artifact [d382f915ee]:


713
714
715
716
717
718
719

720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
	if (fd == -1 || atEndOfStream || write(fd, buffer, length) < length)
		@throw [OFWriteFailedException exceptionWithClass: [self class]
							   stream: self
						  requestedLength: length];
}

- (void)lowlevelSeekToOffset: (off_t)offset

{
	if (lseek(fd, offset, SEEK_SET) == -1)
		@throw [OFSeekFailedException exceptionWithClass: [self class]
							  stream: self
							  offset: offset
							  whence: SEEK_SET];
}

- (off_t)lowlevelSeekForwardWithOffset: (off_t)offset
{
	off_t ret;

	if ((ret = lseek(fd, offset, SEEK_CUR)) == -1)
		@throw [OFSeekFailedException exceptionWithClass: [self class]
							  stream: self
							  offset: offset
							  whence: SEEK_CUR];

	return ret;
}

- (off_t)lowlevelSeekToOffsetRelativeToEnd: (off_t)offset
{
	off_t ret;

	if ((ret = lseek(fd, offset, SEEK_END)) == -1)
		@throw [OFSeekFailedException exceptionWithClass: [self class]
							  stream: self
							  offset: offset
							  whence: SEEK_END];

	return ret;
}

- (int)fileDescriptorForReading
{
	return fd;
}








>

|



|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







713
714
715
716
717
718
719
720
721
722
723
724
725
726


























727
728
729
730
731
732
733
	if (fd == -1 || atEndOfStream || write(fd, buffer, length) < length)
		@throw [OFWriteFailedException exceptionWithClass: [self class]
							   stream: self
						  requestedLength: length];
}

- (void)lowlevelSeekToOffset: (off_t)offset
		      whence: (int)whence
{
	if (lseek(fd, offset, whence) == -1)
		@throw [OFSeekFailedException exceptionWithClass: [self class]
							  stream: self
							  offset: offset
							  whence: whence];


























}

- (int)fileDescriptorForReading
{
	return fd;
}

818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
{
	@throw [OFNotImplementedException exceptionWithClass: [self class]
						    selector: _cmd];
	[super dealloc];	/* Get rid of stupid warning */
}

- (void)lowlevelSeekToOffset: (off_t)offset
{
	@throw [OFNotImplementedException exceptionWithClass: [self class]
						    selector: _cmd];
}

- (off_t)lowlevelSeekForwardWithOffset: (off_t)offset
{
	@throw [OFNotImplementedException exceptionWithClass: [self class]
						    selector: _cmd];
}

- (off_t)lowlevelSeekToOffsetRelativeToEnd: (off_t)offset
{
	@throw [OFNotImplementedException exceptionWithClass: [self class]
						    selector: _cmd];
}
@end







<
<
<
<
|
<
<
<
<
<
<
<





793
794
795
796
797
798
799




800







801
802
803
804
805
{
	@throw [OFNotImplementedException exceptionWithClass: [self class]
						    selector: _cmd];
	[super dealloc];	/* Get rid of stupid warning */
}

- (void)lowlevelSeekToOffset: (off_t)offset




		      whence: (int)whence







{
	@throw [OFNotImplementedException exceptionWithClass: [self class]
						    selector: _cmd];
}
@end