ObjFW  Diff

Differences From Artifact [809a668c5e]:

To Artifact [e89fd4d506]:


749
750
751
752
753
754
755
756
757


758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776


777
778
779
780
781
782
783


784
785
786
787
788
789
790
791
792
793
794
795


796
797
798
799
800
801
802
803
804

805
806
807














808
809
810
811
812
813
814
815
816
817
818
819
820
821
822

823
824
825
826
827

828
829
830
831
832
833
834
749
750
751
752
753
754
755


756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774


775
776
777
778
779
780
781


782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807



808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835

836
837
838
839
840

841
842
843
844
845
846
847
848







-
-
+
+

















-
-
+
+





-
-
+
+












+
+









+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+














-
+




-
+







}
@end

#ifndef _WIN32
@implementation OFChangeFileOwnerFailedException
+ newWithClass: (Class)class_
	  path: (OFString*)path
	 owner: (uid_t)owner
	 group: (gid_t)group
	 owner: (OFString*)owner
	 group: (OFString*)group
{
	return [[self alloc] initWithClass: class_
				      path: path
				     owner: owner
				     group: group];
}

- initWithClass: (Class)class_
{
	Class c = isa;
	[self release];
	@throw [OFNotImplementedException newWithClass: c
					      selector: _cmd];
}

- initWithClass: (Class)class_
	   path: (OFString*)path_
	  owner: (uid_t)owner_
	  group: (gid_t)group_
	  owner: (OFString*)owner_
	  group: (OFString*)group_
{
	self = [super initWithClass: class_];

	@try {
		path  = [path_ copy];
		owner = owner_;
		group = group_;
		owner = [owner_ copy];
		group = [group_ copy];
		errNo = GET_ERRNO;
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- (void)dealloc
{
	[path release];
	[owner release];
	[group release];

	[super dealloc];
}

- (OFString*)description
{
	if (description != nil)
		return description;

	if (group == nil)
	description = [[OFString alloc] initWithFormat:
	    @"Failed to change owner for file %s to %d:%d in class %s! " ERRFMT,
	    [path cString], owner, group, [inClass className], ERRPARAM];
		description = [[OFString alloc] initWithFormat:
		    @"Failed to change owner for file %s to %s in class %s! "
		    ERRFMT, [path cString], [owner cString],
		    [inClass className], ERRPARAM];
	else if (owner == nil)
		description = [[OFString alloc] initWithFormat:
		    @"Failed to change group for file %s to %s in class %s! "
		    ERRFMT, [path cString], [group cString],
		    [inClass className], ERRPARAM];
	else
		description = [[OFString alloc] initWithFormat:
		    @"Failed to change owner for file %s to %s:%s in class %s! "
		    ERRFMT, [path cString], [owner cString], [group cString],
		    [inClass className], ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;
}

- (OFString*)path
{
	return path;
}

- (uid_t)owner
- (OFString*)owner
{
	return owner;
}

- (gid_t)group
- (OFString*)group
{
	return group;
}
@end
#endif

@implementation OFCopyFileFailedException