Take the 2008 Git User's Survey and help out! [ hide ]

public
Description: An OS X application to build a standalone web site as an export from my photo album.
Homepage: http://bleu.west.spy.net/~dustin/projects/photosync/
Clone URL: git://github.com/dustin/photosync.git
Search Repo:
make sure the destination directory exists before syncing
dustin (author)
Sat Feb 05 16:25:15 -0800 2005
commit  5e7b82b12d44d1a2ae25e3bbb9fcedd6f65a9fc8
tree    a797ac34dbecf8f60328a6402bbed390f2e6c7e8
parent  86107a1ed668b79cc445feb85c934010b6b30e66
...
84
85
86
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
88
89
...
94
95
96
97
 
98
99
100
...
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
...
110
111
112
 
113
114
115
116
0
@@ -84,6 +84,22 @@
0
   }
0
 }
0
 
0
+-(BOOL)destExists:(Location *)location
0
+{
0
+ NSFileManager *fm=[NSFileManager defaultManager];
0
+ BOOL rv=NO;
0
+ BOOL isDir=NO;
0
+ NSString *destDir=[location destDir];
0
+ if([fm fileExistsAtPath:destDir isDirectory:&isDir] && isDir) {
0
+ rv=YES;
0
+ } else {
0
+ NSRunAlertPanel(@"Destination missing",
0
+ [NSString stringWithFormat:@"Destination is missing: %@", destDir],
0
+ @"OK", nil, nil);
0
+ }
0
+ return(isDir);
0
+}
0
+
0
 - (IBAction)performSync:(id)sender
0
 {
0
   NSLog(@"Grabbing index");
0
@@ -94,7 +110,7 @@
0
   NSEnumerator *e=[[locTable dataSource] objectEnumerator];
0
     id object=nil;
0
     while(object = [e nextObject]) {
0
- if([object isActive]) {
0
+ if([object isActive] && [self destExists:object]) {
0
       NSLog(@"Setting up %@ with %d",
0
         [object url], [[object username] retainCount]);
0
       SyncTask *st=[[SyncTask alloc] initWithLocation:object

Comments

    No one has commented yet.