Options

List of Files in a directory

skblamskblam Member Posts: 24
edited 2002-03-07 in Navision Financials
Hi,

I would like to know how can I get the list of files in a specific Directory.

Thanks for your Help
<img border="0" title="" alt="" src="images/smiles/icon_rolleyes.gif" />

SL.

Comments

  • Options
    wonmowonmo Member Posts: 139
    You can do a SHELL statement:

    eg.
    SHELL('c:\windows\dir');

    You can also use any automation variable which would support this capability. Try Microsoft Shell Controls and Automation.
  • Options
    skblamskblam Member Posts: 24
    Hi Yang,

    To be able to use the automation controls, I shall need the automation granule (C/OCX license).

    please confirm.

    Thanks for your help

    SL. <img border="0" title="" alt="" src="images/smiles/icon_smile.gif" />
  • Options
    cweegecweege Member Posts: 10
    You can define a variable: Name = files; datatype = record, Subtype = File

    With the following code you have the list of files in the table files.


    files.SETRANGE(Path,'C:\');
    files.FIND('-');
    files.SETRANGE(Path,'Name of the directory');
    files.SETRANGE("Is a file",TRUE);
  • Options
    skblamskblam Member Posts: 24
    What I would like to do is :

    - Get a list the files.
    - Load these files in Navsion with the appropriate Dataport
    - Back up the Files.

    So, I need to store the filename in my Code Unit.

    How can I get store the filenames in my codeunit.

    Thanks
    SL.
    <img border="0" title="" alt="" src="images/smiles/icon_wink.gif" />
  • Options
    wonmowonmo Member Posts: 139
    You can't "store" file names in a codeunit. Use a table object for this. And yes, you do need the C/OCX license to create automation variables. It costs about $1100. Just contact Axentia if you want to purchase.
  • Options
    QuasimodoQuasimodo Member Posts: 45
    On the installation CD of Navision, there is a 'tool' called compare. If you load these fob's, you can look how to manage your problem very easily. I have done this for one of our clients.
  • Options
    cweegecweege Member Posts: 10
    sorry, I don't understand why you must store the filenames in the codeunit !
    you have the filenames in the temporary table and you can store these in a "normal table".
  • Options
    gedasgedas Member Posts: 87
    There are 2 system tables in Navision show you drive and files. In Attain 2000000020 - drive, and 20000000022 - File. Why not use these???? <img border="0" title="" alt="" src="images/smiles/icon_cool.gif" />
    GB
Sign In or Register to comment.