Here's a method I've made for deleting files one-by-one. You can probably use something like that.

client server static boolean deleteFiles(str fileMask)
{
    Filename    filename;
    Filename    fileExt;
    FilePath    filePath;
    boolean     returnValue;
    int         handle;
    ;
    [filePath, filename, fileExt] = fileNameSplit(fileMask);
    [handle, filename] = winapi::findfirstfile(fileMask);
    returnValue = true;
    while (filename != '')
    {   //. og .. filerne behandles ikke
        if ((filename != ".") && (filename != ".."))
        {
            filename = filePath + filename;
            if (winapi::deleteFile(fileName) != 0)
                returnValue = false;
        }
        filename = winapi::findNextFile(handle);
    }
    winapi::findClose(handle);
    return returnValue;
}

Regards
Jan S Dahlsgaard
Fujitsu DK

________________________________

Fra: [email protected] [mailto:[EMAIL PROTECTED] På vegne af gurazadasr
Sendt: 12. december 2005 06:47
Til: [email protected]
Emne: [development-axapta] How to remove hard coded path


Hello,

    My requirement is to remove the hardcoded directory path from
the code while reading an flat file in to the system and to read all
the  files which are contained in that particular folder for example if
I  have a folder by name 'ReadFlatFiles' which contains 10 flat
files, I  want to read all the files one by one without hardcoding the
file name  at the same time I should not specify any specific directory
name like  C:\\...or D:\\ i.e just by mentioning the folder name, I
should able to  read all the files contained in that folder.
             
I heard that it can be done through WinAPI classes, but I am not sure
whether it can be done through it or not also till now I did not work
on those classes, if you have any sample code or any suggestions on
WinAPI class or to solve the above problem are greately  welcome.

Regds
SG









SPONSORED LINKS
Computer part <http://groups.yahoo.com/gads?t=ms&k=Computer+part&w1=Computer+part&w2=Programming+languages&w3=Microsoft+axapta&w4=Support+exchange&c=4&s=90&.sig=yLpvcLTIDJ5FTkRJGsO11w>        Programming languages <http://groups.yahoo.com/gads?t=ms&k=Programming+languages&w1=Computer+part&w2=Programming+languages&w3=Microsoft+axapta&w4=Support+exchange&c=4&s=90&.sig=cuhEClK4dU4wapXFmKisbQ>        Microsoft axapta <http://groups.yahoo.com/gads?t=ms&k=Microsoft+axapta&w1=Computer+part&w2=Programming+languages&w3=Microsoft+axapta&w4=Support+exchange&c=4&s=90&.sig=yfeG_U6QaLfPOZZIud02Fg>       
Support exchange <http://groups.yahoo.com/gads?t=ms&k=Support+exchange&w1=Computer+part&w2=Programming+languages&w3=Microsoft+axapta&w4=Support+exchange&c=4&s=90&.sig=hy8yRGMzrmxdphyITTUeqA>       

________________________________

YAHOO! GROUPS LINKS


     
*      Visit your group "development-axapta <http://groups.yahoo.com/group/development-axapta> " on the web.
       
*      To unsubscribe from this group, send an email to:
      [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
       
*      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> .


________________________________




[Non-text portions of this message have been removed]






YAHOO! GROUPS LINKS




Reply via email to