Igor Delovski Board Forum Index Igor Delovski Board
My Own Personal Slashdot!
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Files & Directories

 
Post new topic   Reply to topic    Igor Delovski Board Forum Index -> Mac Cocoa
Mac Cocoa  
Author Message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3100
Location: Europe

PostPosted: Mon Dec 07, 2009 7:23 pm    Post subject: Files & Directories Reply with quote

MF - Tracking File system changes

"In my cocoa application ,I m trying to track all filesystem changes like copy,
create and renaming or deletion of file and folder."
Back to top
View user's profile Send private message
delovski



Joined: 14 Jun 2006
Posts: 3524
Location: Zagreb

PostPosted: Sat Mar 13, 2010 11:49 pm    Post subject: Reply with quote

so - Where’s the iPhone MIME type database?

"Basically, you give it a filename, and it uses the path extension to return
the file's MIME type..."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3524
Location: Zagreb

PostPosted: Thu Mar 25, 2010 12:09 am    Post subject: Reply with quote

Jeff LaMarche - Absolute Filenames

"The full pathname to an item in the Documents directory of an application's
sandbox includes not the name of the application, but a UUID (unique ident-
ifier) instead. When you build and run your application, a new UUID is calcu-
lated if, and only if, something has changed since your last build. If you ha-
ven't made any changes, it keeps running with the previous UUID. Once you
make some changes to code or a resource and re-compile, the UUID chan-
ges, and the stored absolute path no longer points to the right location."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3524
Location: Zagreb

PostPosted: Tue Apr 20, 2010 8:53 pm    Post subject: Reply with quote

iCodeBlog - Creating a document centric iPhone/iPad application
with own file format using ZipArchive


"If you look at the most of the Apple’s productivity applications you’ll noti-
ce they all use bundles as their output format. ... I am going to be doing
the same today by making my example application create different text
and image files and then zip them together in a single file – this way the
user could then copy this single file over trough iTunes via the file sharing
feature."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3524
Location: Zagreb

PostPosted: Tue May 04, 2010 1:21 am    Post subject: Reply with quote

SO - iPhone write to file (alternative directory)

"New to iPhone 3.2, Apple introduced File-Sharing support."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3524
Location: Zagreb

PostPosted: Sat Feb 26, 2011 4:36 pm    Post subject: Reply with quote

mf - getResourceValue + NSURLIsDirectoryKey fail

"You need to use the path-based NSFileManager APIs. Get the attributes of
the item and check the NSFileType attribute for if it's equal to NSFileType-
Directory."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3524
Location: Zagreb

PostPosted: Fri Oct 14, 2011 7:56 am    Post subject: Reply with quote

http://www.marco.org/2011/10/13/ios5-caches-cleaning
Back to top
View user's profile Send private message Visit poster's website
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3100
Location: Europe

PostPosted: Mon Jul 16, 2012 1:58 am    Post subject: Reply with quote

so - How to detect total available/free disk space on the iPhone/iPad device?

"It returns me exactly the size that iTunes displays when device is connected
to machine."
Back to top
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3100
Location: Europe

PostPosted: Thu Apr 01, 2021 8:55 pm    Post subject: Reply with quote

so - How can I retrieve read/write disk info?

"You can take a look at XRG, which is an activity monitor for OSX. The whole
disk statistics grabber is in XRGDiskView.m, in the getDISKcounters function.

To sum it up, you get a list of hardrives using the following code..."
Back to top
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3100
Location: Europe

PostPosted: Tue Dec 19, 2023 8:29 pm    Post subject: Reply with quote

adc - Technical Q&A NW09 - Testing for a Network Volume

"... you should use NSURL for this. Construct a URL for any item on
the volume and then call -getResourceValue:forKey:error: to get the
NSURLVolumeIsLocalKey key;"


"... you can use the NSURLVolumeSupportsAdvisoryFileLockingKey key
to determine whether a volume supports advisory locking"
Back to top
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3100
Location: Europe

PostPosted: Tue Dec 19, 2023 8:33 pm    Post subject: Reply with quote

Code:
      // If you're working on general application code, you should use NSURL for this.
      // Construct a URL for any item on the volume and then call -getResourceValue:forKey:error: to get the NSURLVolumeIsLocalKey key;
      // the returned value will be false (kCFBooleanFalse) for a network volume and true (kCFBooleanTrue) for a local volume.
     
      NSURL  *url = (NSURL *)urlRef;
      id      value = nil;
      BOOL    ok = [url getResourceValue:&value forKey:NSURLVolumeIsLocalKey error:nil];
     
      if (ok)
         NSLog (@"Volume: %@ has this value: %@\n", url, value);
     
      ok = [url getResourceValue:&value forKey:NSURLVolumeSupportsAdvisoryFileLockingKey error:nil];
      if (ok)
         NSLog (@"Volume: %@ has this value: %@\n", url, value);
     
      CFRelease (urlRef);
     
      if (FSRefMakePath(parentFSRef, (UInt8 *)fullPath, PATH_MAX))
         fullPath[0] = '\0';
     
      if (!FSGetCatalogInfo(parentFSRef, kFSCatInfoVolume, &catalogInfo, NULL, NULL, NULL))  {
         if (id_SupportsExclusiveFileAccess (catalogInfo.volume))
            NSLog (@"Volume: %hd supports file locking - YES!\n", catalogInfo.volume);
         else
            NSLog (@"Volume: %hd DOES NOT support file locking\n", catalogInfo.volume);

         if (FSGetVolumeParms(catalogInfo.volume, &volParmsInfo, sizeof(GetVolParmsInfoBuffer)) == noErr) {
            if (volParmsInfo.vMServerAdr)
               NSLog(@"The volume has serverAddr.");
            if (volParmsInfo.vMExtendedAttributes & (1 << bIsEjectable))  {  // vMAttrib or vMExtendedAttributes (bSupportsExclusiveLocks)
               NSLog(@"The volume is a shared volume.");
            } else {
               NSLog(@"The volume is not a shared volume.");
            }
         }
      }
Back to top
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3100
Location: Europe

PostPosted: Thu Mar 21, 2024 9:51 am    Post subject: Reply with quote

so - iPhone: How to copy a file from resources to documents?

Code:
BOOL success = [fileManager copyItemAtPath:defaultDBPath toPath:writableDBPath error:&error];

Code:

NSFileManager *fmngr = [[NSFileManager alloc] init];
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"mydb.sqlite" ofType:nil];
NSError *error;
if(![fmngr copyItemAtPath:filePath toPath:[NSString stringWithFormat:@"%@/Documents/mydb.sqlite", NSHomeDirectory()] error:&error]) {
     // handle the error
     NSLog(@"Error creating the database: %@", [error description]);

}
[fmngr release];
Back to top
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3100
Location: Europe

PostPosted: Mon Sep 30, 2024 7:21 pm    Post subject: Reply with quote

so - Mac File association not working. Why or how to debug?

"You could investigate using the lsregister command:

alias lsregister='/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister'
lsregister -lint -f /path/to/your.app

(I'm using Lion. On a different version of the Mac OS, it's possible that the path
to lsregister is different.)"
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Igor Delovski Board Forum Index -> Mac Cocoa All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Delovski.hr
Powered by php-B.B. © 2001, 2005 php-B.B. Group