3000 Speicherkarten und 1 Datei muss ersetzt werden. Please Help.

Was habt ihr alle mit euer SSD/HDD. Die ist sicher nicht der Flaschenhals, siehe #10 wo ich geschrieben habe wieso.
Eher wahrscheinlich die USB-Karten oder der USB 2.0 Bus.

Aber selbst das ist schwer zu beurteilen, weil keiner hier die Größe der Dateien kennt, den Zielspeicher oder sonst etwas. Und mit dem aktuellen Tempo wie sich das hier entwickelt, und seinen nicht vorhandenen Programmierkenntenissen, ist er/sie wahrscheinlich am schnellsten das selbst händisch zu erledigen.
 
Das wird eh in den File Cache geschaufelt sobald er es einmal eingelesen hat[1]. Bei jedem folgendem Schreiben wird das direkt aus dem Memory/RAM auf die USB sticks geschrieben, ohne dass es nochmal von den Massenspeicher seines Macs eingelesen wird. Unter Windows und Linux ist das 100% so, seit Jahren. Von daher halte ich eine extra RAM-Disk für unnötig.

naja, ich dachte mir halt die datei könnte wegen video doch recht groß sein und dann kein cache mehr wirklich greifen …
 
Die Datei die zu ersetzen ist hat ca. 25mb die anderen 7 Dateien sind ähnlich groß.

Gerade einen Kollegen erreicht.

Es sind insgesamt 8 Videodateien mit einer Größe von ingesamt 188mb.

000_Text.mp4 Diese Datei muss ersetzt werden.
001_Text.mp4
002_Text.mp4
003_Text.mp4
004_Text.mp4
005_Text.mp4
006_Text.mp4
007_Text.mp4

Danke aber allen für den tollen Elan hier!
 
  • Gefällt mir
Reaktionen: ekki161 und Fritzfoto
Da ich mich gerade vor der Arbeit drücke habe ich es Dir geschrieben…

Hier der Download-Link der fertigen Anwendung:
https://www.inxota.de/tmp/2018-05-26 - MyAutoCopy.app.zip

Die Anwendung ist nicht signiert, d.h. Du mußt sie mit der rechten Maustaste öffnen.
Zudem läuft die Anwendung nicht in der Sandbox, da sonst die Zugriffsrechte für die Laufwerke nicht ausreichen würden.

Wie funktioniert es?

- Anwendung öffnen
- gewünschte Basisdatei, also die der neue "Master" ist, auf das Dock Icon ziehen
- Anwendung laufen lassen

Jedes Laufwerk, das jetzt angestöpselt wird, wird nach dem Dateinamen geschaut und die Datei gelöscht.
Danach wird die neue Basisdatei drauf kopiert und das Laufwerk ausgeworfen.

Bei mir funktioniert es super…

Viele Grüße



Bildschirmfoto 2018-05-26 um 14.02.17.png




Code:
@implementation AppDelegate

#pragma mark -
#pragma mark NSApplicationDelegate

-(void)applicationDidFinishLaunching:(NSNotification *)aNotification
{

    // …
    
    [self.pTextView setEditable:NO];
    
    // …
    
    [self addLogText:@"Zum Konfigurieren gewünschte Datei auf das Dock Icon ziehen."];
    
    // …
    
}

- (BOOL)application:(NSApplication *)sender
           openFile:(NSString *)filename
{
    
    // …
    
    if([filename length] < 1)
    {
        
        return NO;
        
    }
    
    // …
    
    NSURL *URL = [NSURL fileURLWithPath:filename];
    
    if(URL == nil)
    {
        
        return NO;
        
    }
    
    // …
    
    self.pItemURL = URL;

    // …
    
    [self addLogText:[NSString stringWithFormat:@"Basisdatei gesetzt\n%@", filename]];
    
    // …
    
    [self startWorkspaceNotificationObserver:self];
    
    // …
    
    return YES;
    
    // …
    
}

#pragma mark -
#pragma mark Notifications

-(BOOL)stopWorkspaceNotificationObserver:(id)aSender
{
    
    // …
    
    NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
    
    if(workspace == nil)
    {
        
        return NO;
        
    }
    
    // …
    
    NSNotificationCenter *notificationCenter = [workspace notificationCenter];
    
    if(notificationCenter == nil)
    {
        
        return NO;
        
    }
    
    // …
    
    [notificationCenter removeObserver:self
                                  name:NSWorkspaceDidMountNotification
                                object:nil];
    
    // …
    
    return NO;
    
    // …
    
}

-(BOOL)startWorkspaceNotificationObserver:(id)aSender
{
    
    // …
    
    [self stopWorkspaceNotificationObserver:self];
    
    // …
    
    NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
    
    if(workspace == nil)
    {
        
        return NO;
        
    }
    
    // …
    
    NSNotificationCenter *notificationCenter = [workspace notificationCenter];
    
    if(notificationCenter == nil)
    {
        
        return NO;
        
    }
    
    // …
    
    [notificationCenter addObserver:self
                           selector:@selector(receivedWorkspaceDidMountNotification:)
                               name:NSWorkspaceDidMountNotification
                             object:nil];
    
    // …
    
    return YES;
    
    // …
    
}

-(BOOL)receivedWorkspaceDidMountNotification:(NSNotification*)aNotification
{
    
    // …
    
    if(aNotification == nil)
    {
        
        return NO;
        
    }
    
    // …
    
    if([[aNotification name] isEqualToString:NSWorkspaceDidMountNotification] == NO)
    {
        
        return NO;
        
    }
        
    // …
    
    NSDictionary *dictionary = [aNotification userInfo];
    
    if([dictionary count] < 1)
    {
        
        return NO;
        
    }
    
    // …
    
    NSURL *URL = [dictionary objectForKey:NSWorkspaceVolumeURLKey];
    
    if(URL == nil)
    {
        
        return NO;
        
    }
    
    // …
    
    [self addLogText:[NSString stringWithFormat:@"Laufwerk eingehängt\n%@", [URL path]]];
    
    // …
    
    if([self runActionForDeviceWithURL:URL] == NO)
    {
        
        [self addLogText:@"F E H L E R"];
        
    }
    
    // …
    
    return YES;
    
    // …
    
}

#pragma mark -
#pragma mark Action

-(NSURL*)itemURL
{
    
    // …
    
    NSURL *URL = self.pItemURL;
    
    if(URL == nil)
    {
        
        return nil;
        
    }
    
    // …
    
    return URL;
    
    // …
    
}

-(NSString*)itemName
{
    
    // …
    
    NSURL *URL = [self itemURL];
    
    if(URL == nil)
    {
        
        return nil;
        
    }
    
    // …
    
    NSString *string = [URL lastPathComponent];
    
    if([string length] < 1)
    {
        
        return nil;
        
    }
    
    // …
    
    return string;
    
    // …
    
}

-(BOOL)runActionForDeviceWithURL:(NSURL*)aDeviceURL
{
    
    // …
    
    if(aDeviceURL == nil)
    {
        
        return NO;
        
    }
    
    // …
    
    // NSLog(@"%@", aDeviceURL);
    
    // …
    
    NSString *string = [self itemName];
    
    if([string length] < 1)
    {
        
        return NO;
        
    }
    
    // …
    
    NSURL *URL = [aDeviceURL URLByAppendingPathComponent:string];
    
    if(URL == nil)
    {
        
        return NO;
        
    }
    
    // …
    
    [self addLogText:[NSString stringWithFormat:@"Entferne Datei\n%@", [URL path]]];
    
    // …
    
    NSFileManager *fileManager = [NSFileManager defaultManager];
    
    if(fileManager == nil)
    {
        
        return NO;
        
    }
    
    // …
    
    NSError *error = nil;
    
    // …
    
    [fileManager removeItemAtURL:URL
                           error:&error];
    
    if(error != nil)
    {
        
        return NO;
        
    }
    
    // …
    
    NSURL *itemURL = [self itemURL];
    
    if(itemURL == nil)
    {
        
        return NO;
        
    }

    // …
    
    [self addLogText:[NSString stringWithFormat:@"Kopiere Datei\n%@", [itemURL path]]];
    
    // …
    
    [fileManager copyItemAtURL:itemURL
                         toURL:URL
                         error:&error];
    
    if(error != nil)
    {
        
        return NO;
        
    }
    
    // …
    
    [self addLogText:[NSString stringWithFormat:@"Laufwerk auswerfen\n%@", [aDeviceURL path]]];
    
    // …
    
    NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
    
    if(workspace == nil)
    {
        
        return NO;
        
    }
    
    // …
    
    [workspace unmountAndEjectDeviceAtURL:aDeviceURL
                                    error:&error];
    
    if(error != nil)
    {
        
        return NO;
        
    }
    
    // …
    
    [self addLogText:@"OK"];
    
    // …
    
    return YES;
    
    // …
    
}

#pragma mark -
#pragma mark Text View

-(BOOL)addLogText:(NSString*)aLogText
{
    
    // …
    
    if([aLogText length] < 1)
    {
        
        return NO;
        
    }
    
    // …
    
    NSTextView *textView = self.pTextView;
    
    if(textView == nil)
    {
        
        return NO;
        
    }

    // …
    
    NSString *string = [textView string];
    
    if(string == nil)
    {
        
        string = [NSString string];
        
    }
    
    // …
    
    NSMutableString *mutableString = [NSMutableString stringWithString:string];
    
    if(mutableString == nil)
    {
        
        return NO;
        
    }
    
    // …
    
    string = [NSString stringWithFormat:@"%@\n%@\n\n", [NSDate date], aLogText];
    
    if([string length] < 1)
    {
        
        return NO;
        
    }
    
    // …
    
    [mutableString insertString:string
                        atIndex:0];

    // …
    
    [textView setString:mutableString];
    
    // …
    
    return YES;
    
    // …
    
}

@end
 
  • Gefällt mir
Reaktionen: gainer, FrankyGZ, clusterix und 7 andere
WOW!

Damit habe Ich nicht gerechnet! Herzlichen Dank Dir! Wahnsinn das Forum hier. Soviele produktive Antworten und jetzt noch das!
Irre!

Wie darf ich mich denn erkenntlich zeigen?

Habe Morgen und Mittwoch dafür!
Heute wichtigeres Projekt auf Tisch bekommen.

Weiß nicht was Ich sagen soll! Echt Vielen Dank. Little Pixel!
 
Zurück
Oben Unten