Inherits from EOSObject : NSObject
Declared in EOSFile.h
EOSFile.m

Overview

The EOSFile class is used to represent a file that is stored on a camera.

Instance Methods

attribute:

Gets the attribute of the file.

- (EOSFileAttribute)attribute:(NSError *__autoreleasing *)error

Parameters

error

If unsuccessful, an instance of NSError will describe the problem.

Return Value

If successful an EOSFileAttribute value, otherwise NSNotFound.

Declared In

EOSFile.h

downloadWithOptions:delegate:contextInfo:

Downloads the file asynchronously.

- (void)downloadWithOptions:(NSDictionary *)options delegate:(id<EOSDownloadDelegate>)delegate contextInfo:(id)contextInfo

Parameters

options

A dictionary of options.

delegate

The download delegate.

contextInfo

An object that will be passed to the delegate methods. Can be nil.

Discussion

When the download is completed, the didDownloadFile:withOptions:contextInfo:error method of the delegate object is called. The content of the error returned should be examined to determine if the download completed successfully. See EOSDownloadDelegate for more information. The options dictionary may contain the keys; EOSDownloadDirectoryURL, EOSSaveAsFilename and EOSOverwrite.

Declared In

EOSFile.h

fileAtIndex:error:

Gets the file that is directly contained within a directory at the specified index.

- (EOSFile *)fileAtIndex:(NSUInteger)index error:(NSError *__autoreleasing *)error

Parameters

index

The index of the file to get

error

If unsuccessful, an instance of NSError describes the problem

Return Value

If successful, an EOSFile object representing the file, otherwise nil

Discussion

Use fileCount: to find the valid index range.

Declared In

EOSFile.h

fileCount:

Gets the number of files that are directly contained within a directory.

- (NSNumber *)fileCount:(NSError *__autoreleasing *)error

Parameters

error

If unsuccessful, an instance of NSError describes the problem.

Return Value

If successful, the number of children, otherwise nil.

Declared In

EOSFile.h

files

Gets all of the files that are directly contained within a directory.

- (NSArray *)files

Return Value

an array containing instances of EOSFile.

Discussion

If there is an error retrieving a child, the function will continue without adding it to the array. If you need to check for errors when reteiving each file, use fileAtIndex:error: instead.

Declared In

EOSFile.h

info:

Gets information about the file.

- (EOSFileInfo *)info:(NSError *__autoreleasing *)error

Parameters

error

If unsuccessful, an instance of NSError will describe the problem.

Return Value

if successful, an EOSFileInfo object, otherwise nil

Declared In

EOSFile.h

initWithDirectoryItemRef:

Initializes a newly allocated EOSFile instance with a reference to an EDSDK file object.

- (id)initWithDirectoryItemRef:(EdsDirectoryItemRef)fileRef

Parameters

fileRef

The EDSDK file reference.

Return Value

The initialized EOSFile object.

Declared In

EOSFile.h

remove:

Deletes the file.

- (BOOL)remove:(NSError *__autoreleasing *)error

Parameters

error

If unsuccessful, an instance of NSError will describe the problem.

Return Value

YES if successful, otherwise NO.

Discussion

If the file is a directory, all of its content is deleted except protected files.

Declared In

EOSFile.h

setAttribute:error:

Sets the attribute of the file.

- (BOOL)setAttribute:(EOSFileAttribute)attribute error:(NSError *__autoreleasing *)error

Parameters

attribute

The new attribute.

error

If unsuccessful, an instance of NSError will describe the problem.

Return Value

YES if successful, otherwise NO.

Declared In

EOSFile.h