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 & Networking

 
Post new topic   Reply to topic    Igor Delovski Board Forum Index -> Mac Carbon
Mac Carbon  
Author Message
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Thu Mar 01, 2007 11:00 pm    Post subject: Files & Networking Reply with quote

iDevGames: Reading/writing files in Carbon?

"stdio works fine in a Carbon or Cocoa application, but your initial working
directory may not be where you expect it to be. It's different when running
from Xcode than when launched from the Finder or in other situations."


Last edited by delovski on Thu Nov 18, 2010 8:37 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Sat Mar 03, 2007 12:11 pm    Post subject: Reply with quote

DaniWeb: How to get path of current appl (in char) for Mac OS X

Code:
#include <unistd.h>
#include <iostream>

#define SIZE 1200

int main()
{

    using namespace std;
   
    char    folder[SIZE];
   
    getcwd(folder, SIZE);
   
    cout << "This is the path = " << folder << endl;
}
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Sat Mar 10, 2007 12:34 am    Post subject: Reply with quote

MacRumors - Forums: xcode and input files

"You can set the working directory for your executable in the 'General' tab
in the info window for the executable. To get this window select 'Edit Active
Executable' under 'Projects' in the menu bar. Just set it to whatever you
want."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Sun Mar 18, 2007 1:33 am    Post subject: Reply with quote

ADC: Introduction to Device File Access Guide for Serial I/O

"This document describes how to communicate with a serial device from an
application running in Mac OS X. Before you read this document, you should
be familiar with the I/O Kit’s device interface mechanism and device matching
in particular.

To learn about these things, read Accessing Hardware From Applications."

See also: Serial Port Hardware Interfacing at insanelymac.com.


Last edited by delovski on Fri Apr 13, 2007 12:29 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Fri Mar 23, 2007 1:10 am    Post subject: Reply with quote

comp.sys.mac.programmer.help - Set file Read Only...

"FSSetCatalogInfo can also change the permissions. The FSCatalogInfo
structure has a permissions field that can be interpreted as a FSPermissionInfo
structure. You'd want the kFSCatInfoPermissions flag in the whichInfo argument."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Sun Mar 25, 2007 2:13 am    Post subject: Reply with quote

Can't find the info I need - any help out there???

"The Open dialog box, and the 'odoc' event both return an aeList of aeDescriptors
that represent file paths. ideally, you should write your code so that you pass
the aeList to a common handler."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Sun Apr 15, 2007 2:18 am    Post subject: Reply with quote

What the heck??? FSRefMakePath() weirdness

"Instead of getting back good results like above, for each pass through
the loop, I get a Result value of -2110 (Which I've looked up and found
to be "PathTooLong") a PathLength value of 2, and ThePathBuff holding
absolutely nothing."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Sun May 06, 2007 1:21 pm    Post subject: Reply with quote

FSFindFolder - Folder Manager Reference

"Obtains location information for system-related directories."

Code:
OSErr FSFindFolder (
   short vRefNum,
   OSType folderType,
   Boolean createFolder,
   FSRef * foundRef
);
Back to top
View user's profile Send private message Visit poster's website
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3025
Location: Europe

PostPosted: Wed May 09, 2007 4:52 pm    Post subject: Reply with quote

ADC: FSCompareFSRefs - File Manager Reference

Code:
OSErr FSCompareFSRefs (
 const FSRef *ref1,
 const FSRef *ref2
);

If the two FSRef structures refer to the same file or directory, then noErr
is returned. If they refer to objects on different volumes, then diffVolErr is
returned. If they refer to different files or directories on the same volume,
then errFSRefsDifferent is returned.

You must use FSCompareFSRefs ... to compare FSRef structures. It is not
possible to compare the FSRef structures directly since some bytes may be
uninitialized, case-insensitive text, or contain hint information.
Back to top
View user's profile Send private message
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Sun May 20, 2007 12:22 am    Post subject: Reply with quote

Carbon List: Setting file type

"The CatalogInfo has the finderInfo removed and replaced with an array to
fill the missing space. The docs on Apple's website say 'The File Manager
does not interpret the contents of these fields'.

The only API's I can find to change the file type/creator require the use of
FSSpec's. I know I must be missing something."


Related example at CarbonDev: SetFinderInfo shows how to fill in the Finder
info for FileType and FileCreator. Make sure you see File Manager page while
you're there.
Back to top
View user's profile Send private message Visit poster's website
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3025
Location: Europe

PostPosted: Sun May 20, 2007 6:18 pm    Post subject: Reply with quote

ADC: TN2037 - Exclusive File Access in Mac OS X

"Mac OS X's BSD subsystem does not enforce file read/write privileges in
the same way as classic Mac OS. Opening a file for writing does not ensure
other processes can not write to the same file. The default behavior of BSD
allows for multiple 'writers' to a single file."
Back to top
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3025
Location: Europe

PostPosted: Tue Jun 19, 2007 3:02 pm    Post subject: Reply with quote

Get Percent of Disk Used in a C/C++ program

"FSGetVolumeInfo will fill out a FSVolumeInfo structure. These fields in
that structure are of interest:
UInt32 blockSize;
UInt32 totalBlocks;
UInt32 freeBlocks;"
Back to top
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3025
Location: Europe

PostPosted: Fri Sep 28, 2007 9:56 pm    Post subject: Reply with quote

adc - TN2015 - Locating Application Support Files under Mac OS X

"Apple recommends that such files are stored in special folders such as the
Application Support, Scripting Additions, Scripts, and Internet Plug-Ins folders,
which can be located using the FindFolder API that works transparently on Mac
OS 8, 9, and Mac OS X, but some developers prefer to store those files in
folders located adjacent to the related application.

In order to locate those files, the application has to locate itself first."
Back to top
View user's profile Send private message
XNote
Kapetan


Joined: 16 Jun 2006
Posts: 532

PostPosted: Fri Nov 16, 2007 4:50 pm    Post subject: Reply with quote

xcode-users - -42 errors and GDB...grrrr

"Turns out that normally the default number of open files allowed is 256 but
when an app is running in GDB it's RLIM_INFINITY (10240 to be exact)."
Back to top
View user's profile Send private message
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Wed May 14, 2008 6:08 pm    Post subject: Reply with quote

Where to Put Application Files

"For information about the purpose and intended content of specific Library
subdirectories, see “The Library Directory.”

Contents:
Support Files
Plug-Ins
Temporary Files
Cache Files
Don’t Pollute User Space"
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Mon Nov 10, 2008 3:58 am    Post subject: Reply with quote

TN2037 - Exclusive File Access in Mac OS X

"This document discusses the issues surrounding obtaining exclusive file
access in current versions of Mac OS X and how it differs from classic Mac
OS. Exclusive file access is an issue which affects all Mac OS X developers,
Carbon, Cocoa, Java, and BSD."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Thu Nov 18, 2010 8:38 pm    Post subject: Reply with quote

purplebeanie.com - Core Foundation for FTP

"First of all I was really surprised at how quick it was to actually get a fairly
rudimentary FTP solution up and running using Core Foundation."
Back to top
View user's profile Send private message Visit poster's website
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3025
Location: Europe

PostPosted: Mon Feb 25, 2013 9:47 pm    Post subject: Reply with quote

ADC - libcurl - client-side URL transfers

"This is a short overview on how to use libcurl in your C programs. There
are specific man pages for each function mentioned in here.

There are also the libcurl-easy(3) man page, the libcurl-multi(3) man
page, the libcurl-share(3) man page and the libcurl-tutorial(3) man page
for in-depth understanding on how to program with libcurl."
Back to top
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3025
Location: Europe

PostPosted: Mon Feb 25, 2013 9:48 pm    Post subject: Reply with quote

curl.haxx.se - Using The libcurl C Interface

"There's the tutorial to start with, read the tutorial to get a general in-depth
grip of what libcurl programming is all about.

There are some example C source codes you can check out. They're not
all-covering or even very extensive, but they might serve as a source of
inspiration to start hacking."



For a small example that shows how to use a client certificate with libcurl,
see this:
simplessl.c
Back to top
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3025
Location: Europe

PostPosted: Thu Oct 12, 2023 8:30 am    Post subject: Reply with quote

adc - Resolving Aliases

"To resolve aliases in a path contained in an NSString, you need to first convert
the string to a URL, convert the URL to an FSRef, resolve the alias, and reverse
the series of conversions to yield another NSString."
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 Carbon 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