Updated signature; replaced "obos" with "haiku".
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18583 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
* ZipOMatic.rdef
|
* ZipOMatic.rdef
|
||||||
*/
|
*/
|
||||||
|
|
||||||
resource app_signature "application/x-vnd.obos.zip-o-matic";
|
resource app_signature "application/x-vnd.haiku.zip-o-matic";
|
||||||
|
|
||||||
resource app_flags B_SINGLE_LAUNCH;
|
resource app_flags B_SINGLE_LAUNCH;
|
||||||
|
|
||||||
|
|||||||
@@ -1,47 +1,53 @@
|
|||||||
// license: public domain
|
/*
|
||||||
// authors: [email protected]
|
* Copyright 2003-2006, Haiku, Inc. All Rights Reserved.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*
|
||||||
|
* Authors:
|
||||||
|
* Jonas Sundström, [email protected]
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "ZipOMaticMisc.h"
|
#include "ZipOMaticMisc.h"
|
||||||
|
|
||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
|
#include <Path.h>
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
find_and_create_directory (directory_which a_which, BVolume * a_volume, const char * a_relative_path, BPath * a_full_path)
|
find_and_create_directory(directory_which which, BVolume* volume,
|
||||||
|
const char* relativePath, BPath* fullPath)
|
||||||
{
|
{
|
||||||
status_t status = B_OK;
|
BPath path;
|
||||||
BPath path;
|
status_t status = find_directory(which, &path, true, volume);
|
||||||
mode_t mask = 0;
|
|
||||||
|
|
||||||
status = find_directory (a_which, & path, true, a_volume); // create = true
|
|
||||||
|
|
||||||
if (status != B_OK)
|
if (status != B_OK)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
if (a_relative_path != NULL)
|
if (relativePath != NULL) {
|
||||||
{
|
path.Append(relativePath);
|
||||||
path.Append(a_relative_path);
|
|
||||||
|
mode_t mask = umask(0);
|
||||||
mask = umask (0);
|
umask(mask);
|
||||||
umask (mask);
|
|
||||||
|
status = create_directory(path.Path(), mask);
|
||||||
status = create_directory (path.Path(), mask);
|
|
||||||
if (status != B_OK)
|
if (status != B_OK)
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (a_full_path != NULL)
|
if (fullPath != NULL) {
|
||||||
{
|
status = fullPath->SetTo(path.Path());
|
||||||
status = a_full_path->SetTo(path.Path());
|
|
||||||
if (status != B_OK)
|
if (status != B_OK)
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
error_message (const char * a_text, int32 a_status)
|
void
|
||||||
|
error_message(const char* text, int32 status)
|
||||||
{
|
{
|
||||||
PRINT(("%s: %s\n", a_text, strerror(a_status)));
|
PRINT(("%s: %s\n", text, strerror(status)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,24 +1,28 @@
|
|||||||
#ifndef __ZIPOMATIC_MISC__
|
/*
|
||||||
#define __ZIPOMATIC_MISC__
|
* Copyright 2003-2006, Haiku, Inc. All Rights Reserved.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*
|
||||||
|
* Authors:
|
||||||
|
* Jonas Sundström, [email protected]
|
||||||
|
*/
|
||||||
|
#ifndef ZIPOMATIC_MISC_H
|
||||||
|
#define ZIPOMATIC_MISC_H
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <String.h>
|
|
||||||
|
|
||||||
#include <SupportDefs.h>
|
|
||||||
#include <Volume.h>
|
|
||||||
#include <Path.h>
|
|
||||||
#include <Directory.h>
|
#include <Directory.h>
|
||||||
#include <FindDirectory.h>
|
#include <FindDirectory.h>
|
||||||
|
|
||||||
#define ZIPOMATIC_APP_SIG "application/x-vnd.obos.zip-o-matic"
|
class BPath;
|
||||||
|
class BVolume;
|
||||||
|
|
||||||
|
|
||||||
|
#define ZIPOMATIC_APP_SIG "application/x-vnd.haiku.zip-o-matic"
|
||||||
#define ZIPOMATIC_APP_NAME "ZipOMatic"
|
#define ZIPOMATIC_APP_NAME "ZipOMatic"
|
||||||
|
|
||||||
#define ZIPPO_WINDOW_QUIT 'winq'
|
#define ZIPPO_WINDOW_QUIT 'winq'
|
||||||
|
|
||||||
status_t find_and_create_directory (directory_which a_which, BVolume * a_volume = NULL, const char * a_relative_path = NULL, BPath * a_full_path = NULL);
|
status_t find_and_create_directory(directory_which which, BVolume* volume = NULL,
|
||||||
|
const char* relativePath = NULL, BPath* fullPath = NULL);
|
||||||
void error_message (const char * a_text, int32 a_status);
|
void error_message(const char* text, int32 status);
|
||||||
|
|
||||||
#endif // __ZIPOMATIC_MISC__
|
|
||||||
|
|
||||||
|
#endif // ZIPOMATIC_MISC_H
|
||||||
|
|||||||
Reference in New Issue
Block a user