#1 Burning Software

It is currently Thu Dec 19, 2024 7:11 am

All times are UTC




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Single File
PostPosted: Sat Jan 29, 2005 12:47 am 
How do I add a single file or selected files of a directory to an ISO9960Joliet_FileTree?

All of the examples deal with entire directories or an ISO image.


Top
  
 
 Post subject: Re: Single File
PostPosted: Sun Jan 30, 2005 1:04 pm 
Offline

Joined: Mon May 31, 2004 6:22 am
Posts: 134
Anonymous wrote:
How do I add a single file or selected files of a directory to an ISO9960Joliet_FileTree?

All of the examples deal with entire directories or an ISO image.


You can use StarBurn_ISO9660JolietFiletree_Add() function to create:
1. folder with all subfolders from your harddrive
2. empty folder (leave absolute path as NULL)
3. file from you harddrive (just pass the filename as absolute path)


Top
 Profile  
 
 Post subject: Documentation Change?
PostPosted: Sat Feb 12, 2005 5:26 am 
So the documentation needs a little tweaking? In StarBurn_ISO9660JolietFileTree_Add it says p__PCHAR__RootDirectoryAbsolutePathAndName should contain "Pointer to directory name". But in fact, you can also pass an individual file name?


Top
  
 
 Post subject: Re: Documentation Change?
PostPosted: Sat Feb 12, 2005 8:03 am 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
Yes, you're correct. See, docummentations says:

Abstract

This function adds the tree created from the directory (or just single individual file) to already created ISO9660 or Joliet file tree from passed directory. Later this tree can be used to build "virtual" ISO96600 or Joliet file system image. Resulting "virtual" image can be either stored in the file on the disk or be burn directly to the CD/DVD media w/o any other intermediate operations

But parameter is kept names p__PCHAR__RootDirectoryAbsolutePathAndName which is a bit confusing. We'll fix this in upcoming version. Thank you for pointing :-)

betty crokker wrote:
So the documentation needs a little tweaking? In StarBurn_ISO9660JolietFileTree_Add it says p__PCHAR__RootDirectoryAbsolutePathAndName should contain "Pointer to directory name". But in fact, you can also pass an individual file name?


Top
 Profile  
 
 Post subject: Re: Documentation Change?
PostPosted: Fri Aug 03, 2007 12:04 pm 
Offline

Joined: Fri Jul 20, 2007 1:20 pm
Posts: 11
I want to change file name to be burned to a disc.
For example I want to burn file D:\Folder\File.txt and I want that it's new name on a disk will be BurnedFile.txt

I pass params to StarBurn_ISO9660JolietFileTree_Add function in this way
Code:
CString strExistingFile(_T("D:\Folder\File.txt"));
CString strExistingFile(_T("BurnedFile.txt"));

_Result = StarBurn_ISO9660JolietFileTree_Add(
            _ISOImage,
            (PCHAR)&_ExceptionText,
            sizeof(_ExceptionText),
            &_Status,
            const_cast<LPTSTR>((LPCTSTR)strExistingFile),
            const_cast<LPTSTR>((LPCTSTR)strNewName),
            FILE_TIME_LAST_WRITE,
            &pParentNode,
            &pNewNode);
But file name of the burned file is still File.txt. Why? :cry:

And function StarBurn_ISO9660JolietFileTree_SetNames accept only single-byte chars - when I try to set name using multi-bytes chars the filename is truncated to the first file name symbol because second byte in file name is 0.


Top
 Profile  
 
 Post subject: Re: Documentation Change?
PostPosted: Fri Aug 03, 2007 4:58 pm 
Offline

Joined: Fri Jan 26, 2007 4:31 pm
Posts: 452
Niraxoid wrote:
I want to change file name to be burned to a disc.
For example I want to burn file D:\Folder\File.txt and I want that it's new name on a disk will be BurnedFile.txt

I pass params to StarBurn_ISO9660JolietFileTree_Add function in this way
Code:
CString strExistingFile(_T("D:\Folder\File.txt"));
CString strExistingFile(_T("BurnedFile.txt"));

_Result = StarBurn_ISO9660JolietFileTree_Add(
            _ISOImage,
            (PCHAR)&_ExceptionText,
            sizeof(_ExceptionText),
            &_Status,
            const_cast<LPTSTR>((LPCTSTR)strExistingFile),
            const_cast<LPTSTR>((LPCTSTR)strNewName),
            FILE_TIME_LAST_WRITE,
            &pParentNode,
            &pNewNode);
But file name of the burned file is still File.txt. Why? :cry:

And function StarBurn_ISO9660JolietFileTree_SetNames accept only single-byte chars - when I try to set name using multi-bytes chars the filename is truncated to the first file name symbol because second byte in file name is 0.


Please check your code, I don't see initializing of "strNewName" in your code example.
In your program check pointer to new node name string, if this pointer is NULL then node will be have original name.

About StarBurn_ISO9660JolietFileTree_SetNames() you are right, sorry but now we have not Unicode support. Wait on next release with full Unicode support.


Top
 Profile  
 
 Post subject: Re: Documentation Change?
PostPosted: Mon Aug 06, 2007 5:32 am 
Offline

Joined: Fri Jul 20, 2007 1:20 pm
Posts: 11
Oops! Sory It's my copy-past to post error :P. Original code is:
Code:
CString strNewName(_T("BurnedFile.txt"));
But problems still exist because strNewName is not empty...


Top
 Profile  
 
 Post subject: Re: Documentation Change?
PostPosted: Mon Aug 06, 2007 7:48 am 
Offline

Joined: Fri Jan 26, 2007 4:31 pm
Posts: 452
Niraxoid wrote:
Oops! Sory It's my copy-past to post error :P. Original code is:
Code:
CString strNewName(_T("BurnedFile.txt"));
But problems still exist because strNewName is not empty...


Can you send to me your source code (or part of source code), and i'll try to solve problem.


Top
 Profile  
 
 Post subject: Re: Documentation Change?
PostPosted: Mon Aug 06, 2007 12:54 pm 
Offline

Joined: Fri Jul 20, 2007 1:20 pm
Posts: 11
andrey(staff) wrote:
Can you send to me your source code (or part of source code), and i'll try to solve problem.


Yes I can.
For example I've created source code shows this problem. Can I post code here?


Code:
PVOID ISOImage = NULL;

EXCEPTION_NUMBER Result = EN_SUCCESS;

ULONG Status = NO_ERROR;

CHAR ExceptionText[1024];

CDB_FAILURE_INFORMATION FailureInformation;

VOID PrintResult(const EXCEPTION_NUMBER result);

VOID CALLBACK ISOImageCallback(CALLBACK_NUMBER eCallbackNumber,
                               PVOID           pCallbackContext,
                               PVOID           pCallbackSpecial1,
                               PVOID           pCallbackSpecial2);

int main(void)
{
    std::cout << "Try to init StarBurn..." << std::endl;
    Result = StarBurn_UpStartEx( g__UCHAR__RegistrationKey, sizeof(g__UCHAR__RegistrationKey));
    PrintResult(Result);

    std::cout << "Try to create ISO image object..." << std::endl;
    Result = StarBurn_ISO9660JolietFileTree_Create(
        &ISOImage,
        ExceptionText,
        sizeof(ExceptionText),
        &Status,
        (PCALLBACK)ISOImageCallback,
        NULL,
        FALSE,
        FALSE,
        TRUE,
        FILE_TREE_JOLIET);
    PrintResult(Result);

    PVOID pRootNode = NULL;
    PVOID pNewNode = NULL;

    std::cout << "Try to create ISO image object..." << std::endl;
    StarBurn_ISO9660JolietFileTree_GetRoot(ISOImage);
    if (NULL != pRootNode)
    {
        PrintResult(EN_SUCCESS);
    }
    else
    {
        PrintResult(EN_FAILURE);
    }

    TCHAR strExistingFile[MAX_PATH];
    TCHAR strTargetFile[MAX_PATH];
    TCHAR strAbs[MAX_PATH];
    TCHAR strLong[MAX_PATH];
    TCHAR strShort[MAX_PATH];

    memset(strExistingFile,0,sizeof(strExistingFile));
    memset(strTargetFile,0,sizeof(strTargetFile));
    memset(strAbs,0,sizeof(strAbs));
    memset(strLong,0,sizeof(strLong));
    memset(strShort,0,sizeof(strShort));

    wcscpy(strExistingFile,_T("FILE.jpg"));
    wcscpy(strTargetFile,_T("NEW_FILE.jpg"));

    std::cout << "Try add file to an ISO image" << std::endl;
    Result = StarBurn_ISO9660JolietFileTree_AddW(
        ISOImage,
        (PCHAR)&ExceptionText,
        sizeof(ExceptionText),
        &Status,
        (TCHAR*)&strExistingFile,
        (TCHAR*)&strTargetFile,
        FILE_TIME_LAST_WRITE,
        &pRootNode,
        &pNewNode);
    PrintResult(Result);

    std::cout << "Try get names for created node..." << std::endl;
    if (NULL != pNewNode)
    {
        StarBurn_ISO9660JolietFileTree_GetNamesW(
            ISOImage,
            pNewNode,
            strAbs,
            strLong,
            strShort);

        PrintResult(EN_SUCCESS);
    }
    else
    {
        PrintResult(EN_FAILURE);
    }

    std::cout << "Try delete ISO image object..." << std::endl;
    StarBurn_Destroy(&ISOImage);
    PrintResult(EN_SUCCESS);

    std::cout << "Try to deinit StarBurn..." << std::endl;
    Result = StarBurn_DownShut();
    PrintResult(Result);

    return Result;
}

VOID CALLBACK ISOImageCallback(CALLBACK_NUMBER eCallbackNumber,
                               PVOID           pCallbackContext,
                               PVOID           pCallbackSpecial1,
                               PVOID           pCallbackSpecial2)
{
}

VOID PrintResult(const EXCEPTION_NUMBER result)
{
    if (EN_SUCCESS == result)
    {
        std::cout << "Done." << std::endl;
    }
    else
    {
        std::cout << "Error!" << std::endl;
    }
}


All strAbs, strLong and strShort variables are equals to "FILE.jpg"


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 06, 2007 2:56 pm 
Offline

Joined: Fri Jan 26, 2007 4:31 pm
Posts: 452
Unfortunately we don't support Unicode in this release, and function
StarBurn_ISO9660JolietFileTree_AddW(..)is experimental and description of this function by accident to be placed in helper documentation. In next release this function will be removed from StarBurn API.

Now you can use
StarBurn_ISO9660JolietFileTree_Add(..),
but not
StarBurn_ISO9660JolietFileTree_AddW(..).


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 07, 2007 7:01 am 
Offline

Joined: Fri Jul 20, 2007 1:20 pm
Posts: 11
andrey(staff) wrote:
Unfortunately we don't support Unicode in this release, and function
StarBurn_ISO9660JolietFileTree_AddW(..)is experimental and description of this function by accident to be placed in helper documentation. In next release this function will be removed from StarBurn API.

Now you can use
StarBurn_ISO9660JolietFileTree_Add(..),
but not
StarBurn_ISO9660JolietFileTree_AddW(..).


Ok. Thank you I've got it.

P.S. StarBurn_ISO9660JolietFileTree_AddW descriptions were not found in helper documentation. I found it's definition in StarBurn.h file.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 07, 2007 7:06 am 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
Stick with the generic Add(...) and wait for Version 9 to come.

Niraxoid wrote:
andrey(staff) wrote:
Unfortunately we don't support Unicode in this release, and function
StarBurn_ISO9660JolietFileTree_AddW(..)is experimental and description of this function by accident to be placed in helper documentation. In next release this function will be removed from StarBurn API.

Now you can use
StarBurn_ISO9660JolietFileTree_Add(..),
but not
StarBurn_ISO9660JolietFileTree_AddW(..).


Ok. Thank you I've got it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 38 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group