18 |
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 |
|
*/ |
20 |
|
|
21 |
+ |
#include "sysdeps.h" |
22 |
+ |
|
23 |
|
#include <sys/types.h> |
24 |
|
#include <sys/stat.h> |
25 |
+ |
#include <string.h> |
26 |
|
#include <stdio.h> |
27 |
|
#include <stdlib.h> |
28 |
|
#include <unistd.h> |
29 |
+ |
#include <fcntl.h> |
30 |
|
#include <dirent.h> |
31 |
|
#include <errno.h> |
32 |
|
|
33 |
|
#include <fs_attr.h> |
34 |
+ |
#include <support/TypeConstants.h> |
35 |
+ |
#include <storage/Mime.h> |
36 |
|
|
31 |
– |
#include "sysdeps.h" |
37 |
|
#include "extfs.h" |
38 |
|
#include "extfs_defs.h" |
39 |
|
|
72 |
|
|
73 |
|
|
74 |
|
/* |
75 |
+ |
* Add component to path name |
76 |
+ |
*/ |
77 |
+ |
|
78 |
+ |
void add_path_component(char *path, const char *component) |
79 |
+ |
{ |
80 |
+ |
int l = strlen(path); |
81 |
+ |
if (l < MAX_PATH_LENGTH-1 && path[l-1] != '/') { |
82 |
+ |
path[l] = '/'; |
83 |
+ |
path[l+1] = 0; |
84 |
+ |
} |
85 |
+ |
strncat(path, component, MAX_PATH_LENGTH-1); |
86 |
+ |
} |
87 |
+ |
|
88 |
+ |
|
89 |
+ |
/* |
90 |
|
* Get/set finder type/creator for file specified by full path |
91 |
|
*/ |
92 |
|
|
283 |
|
// Open temporary file for resource fork |
284 |
|
char rname[L_tmpnam]; |
285 |
|
tmpnam(rname); |
286 |
< |
int rfd = open(rname, O_RDWR | O_CREAT | O_TRUNC, 0664); |
286 |
> |
int rfd = open(rname, O_RDWR | O_CREAT | O_TRUNC, 0666); |
287 |
|
if (rfd < 0) { |
288 |
|
close(fd); |
289 |
|
return -1; |