Get File Names & Creation Time of the files of a directory in App. Server

Dear all,
              My requirement is to fetch all the file names of a paritucular direcory in the application server. After going through SDN i got some FM's like
    1. EPS_GET_DIRECTORY_LISTING
    2. EPS_GET_FILE_ATTRIBUTES
    3. SUBST_GET_FILE_LIST
    Here EPS_GET_DIRECTORY_LISTING looks perfect for my requirement. But while I tried to test the FM from SE37 its giving exception READ_DIRECTORY_FAILED for the required Directory. But the same FM is returning file names for the root directory.
Please look a above 2 scenario...
ie. if I give Export parameter as
     DIR_NAME                         = '/'
     FILE_MASK                       = '*'
     The FM works fine.
But . if I give Export parameter as
     DIR_NAME                         = '/XYZ'                      
     FILE_MASK                       = '*'
    The FM returns exception READ_DIRECTORY_FAILED .
But the directory  /XYZ exists and there are files in it..Am I missing something with respect to the path am specifying.
Regards,
Antony

Hi, see if this peace of code helps you.
CONSTANTS DAYS1980 TYPE I VALUE 3652.
DATA: DLIST LIKE EPSFILI OCCURS 0 WITH HEADER LINE, DPATH LIKE EPSF-EPSDIRNAM, MDATE LIKE SY-DATUM, MTIME LIKE SY-UZEIT, POINT_IN_TIME TYPE I.
DATA: BEGIN OF FATTR OCCURS 0, FILE_NAME LIKE EPSF-EPSFILNAM, FILE_SIZE LIKE EPSF-EPSFILSIZ, FILE_OWNER LIKE EPSF-EPSFILOWN, FILE_MODE LIKE EPSF-EPSFILMOD, FILE_TYPE LIKE EPSF-EPSFILTYP, FILE_MTIME(12), END OF FATTR.
PARAMETER P_PATH(50) TYPE C DEFAULT '/TMP' LOWER CASE.
DPATH = P_PATH.
CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
EXPORTING
  DIR_NAME = DPATH
TABLES
  DIR_LIST = DLIST
EXCEPTIONS
  INVALID_EPS_SUBDIR = 1
  SAPGPARAM_FAILED = 2
  BUILD_DIRECTORY_FAILED = 3
  NO_AUTHORIZATION = 4
  READ_DIRECTORY_FAILED = 5
  TOO_MANY_READ_ERRORS = 6
  EMPTY_DIRECTORY_LIST = 7
  OTHERS = 8.
  IF SY-SUBRC EQ 0.
  LOOP AT DLIST.
CALL FUNCTION 'EPS_GET_FILE_ATTRIBUTES'
EXPORTING
  FILE_NAME = DLIST-NAME
  DIR_NAME = DPATH IMPORTING
  FILE_SIZE = FATTR-FILE_SIZE
  FILE_OWNER = FATTR-FILE_OWNER
  FILE_MODE = FATTR-FILE_MODE
  FILE_TYPE = FATTR-FILE_TYPE
  FILE_MTIME = FATTR-FILE_MTIME.
  FATTR-FILE_NAME = DLIST-NAME.
  APPEND FATTR.
    ENDLOOP.
  ENDIF.
  SORT FATTR BY FILE_NAME.
  LOOP AT FATTR.
  POINT_IN_TIME = FATTR-FILE_MTIME.
  CALL FUNCTION 'POINT_IN_TIME_CONVERT'
  EXPORTING
  POINT_IN_TIME = POINT_IN_TIME
  IMPORTING
  DATE = MDATE
  TIME = MTIME
  EXCEPTIONS OTHERS = 1.
  SUBTRACT DAYS1980 FROM MDATE.
  WRITE: / FATTR-FILE_NAME, FATTR-FILE_SIZE, MDATE, MTIME.
  ENDLOOP.

Similar Messages

  • Using sqlldr to load XML files and the file name ?  or access the file name

    I can use sqlldr to load the XML files when I declare the target table of XMLTYPE, but I need to load the filename and a sequence also with the XML in a table so we can mark wether the file passed validation or not.
    something like ....
    Create table test1
    lobfn varchar(200),
    load_number number,
    XML_COL XMLTYPE
    --------------- here is my sqlldr command
    sqlldr xml_user/xml_user load_test1.ctl
    LOAD DATA
    INFILE *
    INTO TABLE test1
    append
    xmltype(XML_COL)
    lobfn FILLER char TERMINATED by ',',
    XML_COL LOBFILE(lobfn) TERMINATED BY EOF
    BEGINDATA
    filename1.xml
    filename2.xml
    filename64.xml
    sqlldr comes back and says "commit point reached - logical record count 64
    but when I select count(*) from test1; it returns 0 rows.
    and when I
    SELECT X.* FROM tst1 P2,
    XMLTable ( '//XMLRoot//APPLICATION'
    PASSING P2.XML_COL
    COLUMNS
    "LASTNAME" CHAR(31) PATH 'LASTNAME',
    "FIRSTNAME" CHAR(31) PATH 'FIRSTNAME'
    ) AS X;
    It tells me invalid identifier ,
    Do I need to use a function to get the XML_COL as a object_value ???
    But when I create the table like
    create table test1 of XMLTYPE;
    and use sqlldr it works, but I dont have the file name, or dont know how to access it ??
    and I can use
    SELECT X.* FROM tst1 P2,
    XMLTable ( '//XMLRoot//APPLICATION'
    PASSING P2.object_value
    COLUMNS
    "LASTNAME" CHAR(31) PATH 'LASTNAME',
    "FIRSTNAME" CHAR(31) PATH 'FIRSTNAME'
    ) AS X;

    BTW
    Here's a trivial example of what you appear to be trying to do..
    C:\xdb\otn\sqlLoader>sqlplus scott/tiger @createTable
    SQL*Plus: Release 10.2.0.2.0 - Production on Wed Aug 2 22:08:10 2006
    Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> DROP TABLE TEST_TABLE
      2  /
    Table dropped.
    SQL> CREATE TABLE TEST_TABLE
      2  (
      3    filename    VARCHAR2(32),
      4    file_content xmltype
      5  )
      6  /
    Table created.
    SQL> quit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
    With the Partitioning, OLAP and Data Mining options
    C:\xdb\otn\sqlLoader>type sqlldr.ctl
    LOAD DATA
    INFILE 'filelist.txt'
       INTO TABLE TEST_TABLE
       FIELDS TERMINATED BY ','
        FILENAME       CHAR(32),
        FILE_CONTENT   LOBFILE(FILENAME) TERMINATED BY EOF
    C:\xdb\otn\sqlLoader>type filelist.txt
    testcase1.xml
    testcase2.xml
    C:\xdb\otn\sqlLoader>type testcase1.xml
    <foo/>
    C:\xdb\otn\sqlLoader>type testcase1.xml
    <foo/>
    C:\xdb\otn\sqlLoader>sqlldr userid=SCOTT/TIGER control=sqlldr.ctl log=sqlldr.log -direct
    SQL*Loader: Release 10.2.0.2.0 - Production on Wed Aug 2 22:08:11 2006
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Load completed - logical record count 2.
    C:\xdb\otn\sqlLoader>sqlplus scott/tiger
    SQL*Plus: Release 10.2.0.2.0 - Production on Wed Aug 2 22:08:18 2006
    Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> select * from TEST_TABLE
      2  /
    FILENAME
    FILE_CONTENT
    testcase1.xml
    <foo/>
    testcase2.xml
    <baa/>
    SQL>
    If you are interested in the 11g beta program please contact me directory at
    markDOTdrakeAToracleDOTcom

  • Script to create directory based on current file name and then save the file in that directory

    Hi all,
    I have a need save all my projects in a directory using the name of the main image I am working on.
    Manually these are the steps I used:
    Save As.
    Copy ( press command-c <== the filename is highlighted by default so all I have to do is )
    New Folder ( press the new folder button. Brings up a dialog box)
    Paste ( press command-v. <== Pastes the file name into the "New Folder" dialog box.)
    Save ( press thre save button. Saves the files into the new folder )
    Save As.
    Change format to JPG
    Save
    Change image quality to 12
    I want to assign these actions to a key
    Recording these steps and playing them back does not give me the results I need, snce the original name is hard-coded in the actionlist that was recorded
    What should I be doing instead ?
    Thanks in advance !

    You don’t mention which format the original file is (and figuring that and its current settings out seems too much of a hassle to me) so this would only save the jpgs into the folder (and create one if it does not exist).
    If you want to give it a try, paste the following text into a new file in ExtendScript Toolkit (part of Photoshop’s installation, Applications/Utilities/Adobe Utilities/ExtendScript Toolkit CS4 or /Applications/Utilities/Adobe Utilities-CS5/ExtendScript Toolkit CS5) and save it as a jsx-file into Photoshop’s Presets/Scripts-folder.
    After restarting Photoshop the Script should be available under File > Scripts and can be assigned a Keyboard Shortcut directly, recorded into an Action, (in CS4 and CS5) be used in a Configurator-Panel or started from ExtendScript Toolkit directly.
    // saves jpg into folder of file’s name next to file;
    // be advised: this  overwrites existing jpgs of the same name without prompting;
    // thanks to xbytor;
    // 2012, use it at your own risk;
    #target photoshop;
    if (app.documents.length > 0) {
    var thedoc = app.activeDocument;
    // getting the name and location;
    var docName = thedoc.name;
    if (docName.indexOf(".") != -1) {var basename = docName.match(/(.*)\.[^\.]+$/)[1]}
    else {var basename = docName};
    // getting the location, if unsaved save to desktop;
    try {var docPath = thedoc.path}
    catch (e) {var docPath = "~/Desktop"};
    // create folder if it does not exist;
    var folderString = docPath+"/"+basename;
    if (Folder(folderString).exists == false) {new Folder(folderString).create()};
    // jpg options;
    var jpegOptions = new JPEGSaveOptions();
    jpegOptions.quality = 12;
    jpegOptions.embedColorProfile = true;
    jpegOptions.matte = MatteType.NONE;
    //save jpg as a copy:
    thedoc.saveAs((new File(folderString+"/"+basename+".jpg")),jpegOptions,true);

  • I just downloaded iOS 8 on my iPad air. This has caused the file names of all of my PDFs in iBooks to revert to their original file name when I downloaded the file, not the custom file names I gave them after downloading the files. In the list of fil

    PDF file names changed with iOS 8

    Further to above
    Progress Notable!
    But before I outline the details, I wish to apologise to APPLE for laying the blame at their doorstep for loosing or misplacing those PDFs I have on the iPad 1, when I set up my iPad Air , by restoring from the backup of iPad 1, thus copying all data from the old to the new.
    NOT REALLY THEIR FAULT AT ALL
    Because a lot of the many PDFs had the same name, ie PDF.pdf, probably my fault more than anybody else's, so I can't blame APPLE for that. Just goes to show one should be a little more precise in creating these portable documents.
    No wonder the poor program " lost its' marbles" when doing the updating and conversion/transfer.
    However, I was able to recover most of them by personal email, and extracting and RENAMING the PDFs as I located them in their new home.
    Those PDFs that we're locked an thus not email-able , I will deal with by
    Viewing
    Photoeing (if that's how you spell it).
    And re-building the PDF from the photos, in unlocked format, after transferring these files either by Bluetooth or Wi-Fi, from the old to the new iPad.
    So all is not lost, and I am thankful that my cautious approach to this matter in the first place, gave me the ability for this successful recovery.
    That's my story and I'm sticking to it.
    I hope this little story of my saga/experience may prove helpful to others yet to cross the chasm of updating.
    Regards to all, including APPLE.
    NICE STUFF YOU MAKE.

  • Error when uploading; the file name is invalid, or the file is too big

    Hi, I have posted this topic also in this thread, but we are not getting any answer to this problem. Also, the existing discussion in this thread gives us no idea what to do.
    We get the a.m. message when using the "FILE-UPLOAD" UI element only for selected users and for these only in IE8 and not in Firefox.
    So we believe that the cause for the error is likely on the client side, especially in some IE settings.
    Is there any advice available what to look for and where to check?
    Thanks in advance,
    M. Büttner

    Hi,
    Please check with following link.
    Link:[Uploading Notepad File in Webdynpro ABAP;
    Link:[http://help.sap.com/saphelp_nw70ehp1/helpdata/en/48/69ef8be8a607d6e10000000a42189c/frameset.htm]
    Thanks,
    Renuka S.

  • How to get the Output File Name as One of the Field Value From Payload

    Hi All,
    I want to get the Output file name as one of the Field value from payload.
    Example:
    Source XML
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_TEST xmlns:ns0="http://sample.com">
    - <Header>
      <NAME>Bopanna</NAME>
      </Header>
      </ns0:MT_TEST>
    I want to get the Output file name as " Bopanna.xml"
    Please suggest me on this.
    Regards
    Bopanna

    Hi,
    There are couple of links already available for this. Just for info see the below details,
    The Output file name could be used from the field value of payload. For this you need to use the UDF DynamicFile name with below code,
    //       Description: Function to create dynamic Filename
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
    conf.put(key,a);
    return "";
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
    conf.put(key,a);
    return "";
    With this udf map it with the MessageType as
    (File Name field from Payload) > DynamicFileConfiguration>MTReceiver
    Thanks
    Swarup

  • I recently downloaded DOSBOX (a DOS emulator). I have since uninstalled the file and removed it from my download history, yet every time I use Firefox, I get a pop-up to save the file (re-download) again. How do I fix it?

    I recently downloaded DOSBOX (a DOS emulator). I have since uninstalled and removed the file from my system, yet every time I access the net, I get a pop-up to save the file (re-download) again. How do I fix it?

    Sometimes a problem with Firefox may be a result of malware installed on your computer, that you may not be aware of.
    You can try these free programs to scan for malware, which work with your existing antivirus software:
    * [http://www.microsoft.com/security/scanner/default.aspx Microsoft Safety Scanner]
    * [http://www.malwarebytes.org/products/malwarebytes_free/ MalwareBytes' Anti-Malware]
    * [http://support.kaspersky.com/faq/?qid=208283363 TDSSKiller - AntiRootkit Utility]
    * [http://www.surfright.nl/en/hitmanpro/ Hitman Pro]
    * [http://www.eset.com/us/online-scanner/ ESET Online Scanner]
    [http://windows.microsoft.com/MSE Microsoft Security Essentials] is a good permanent antivirus for Windows 7/Vista/XP if you don't already have one.
    Further information can be found in the [[Troubleshoot Firefox issues caused by malware]] article.
    Did this fix your problems? Please report back to us!

  • Truly dumb question. How do I get PS to actually complete a command, eg straighten an horizon, and finalise the change. Even doing a "save as" with a new file name and reloading brings the image back, straightened, but with the skewed back ground frame st

    Truly dumb question. How do I get PS to actually complete a command, eg straighten an horizon, and finalise the change. Even doing a "save as" with a new file name and reloading brings the image back, straightened, but with the skewed back ground frame still there. Is there a "apply change" or similiar command that I simply cannot see.

    brings the image back, straightened, but with the skewed back ground frame
    PSE did what you told it to do. Choose the Straighten and crop edges or fill edges options when you use the straighten tool if you want it to do more than just straighten the contents of the image. Many people prefer the plain straighten because they'd rather crop themselves than let PSE do it.

  • Every time I try to download Firefox, I get an error message tha says the file is corrupt. How do I fix it?

    The file will download approximately 40% and then I get an error message that says the file is corrupt and the download window closes automatically. In addition, I have had this trouble with two separate computers using two different operating systems.

    Download a fresh Firefox copy and save the file to the <u>Desktop</u>.
    * Firefox 6.0.x: http://www.mozilla.com/en-US/firefox/all.html
    * Uninstall your current Firefox version.
    * Do not remove personal data when you uninstall the current version.
    Remove the Firefox program folder before installing that newly downloaded copy of the Firefox installer.
    * It is important to delete the Firefox program folder to remove all the files and make sure that there are no problems with files that were leftover after uninstalling.
    Your bookmarks and other profile data are stored elsewhere in the Firefox Profile Folder and won't be affected by a reinstall, but make sure that you do not select to remove personal data if you uninstall Firefox.
    * http://kb.mozillazine.org/Profile_folder_-_Firefox
    * http://kb.mozillazine.org/Profile_backup

  • ITunes could not copy "insert song" to the iphone "insert name of iphone" because the file could not be read

    It's about time i posted something about my problem because i've searched everywhere and I did not get the answer i wanted.
    When i try to put a song (Drag and Drop) from my Library to my Iphone, the message "iTunes could not copy "insert song" to the iphone "insert name of iphone" because the file could not be read" shows up. I have no idea how to fix this, I haven't seen apple answer to a single one of these threads either.
    I've only seen users try to answer this question.
    Anyways, when i put the songs on my Iphone, it is also grayed out. There is also a dotted circle (symbol) beside the checkmark of the song.
    I've tried creating a AAC version of all the songs already. No luck
    Please help
    meetobin

    Two possibilities come to mind.
    Check your source hard drive for errors, right-click on the drive holding the library, click Properties, tools, check for errors, scan for and attempt recovery of bad sectors...
    Or...
    Repair Security Permissions
    Right-click on your main iTunes folder and click Properties, then go to the Security tab and click Advanced. If necessary grant your account and SYSTEM full control of this folder, subfolders and files, then tick the option to replace permissions on child objects which will repair permissions throughout the library. This is the XP dialog but Windows 7 shouldn't be too different.
    If it won't let you change the permissions use the Owner tab to take ownership from an account with administrator privileges.
    tt2

  • File name selection without selecting the extension

    It would be more user friendly if selecting a file name in the metadata field "File Name" would only select the name and not the name + extension. You mostly don't change the extension but you do change the file name. Now if I want to rename a file I have to place the cursor between the end of the file name and the dot of the extension (an extra click). If you select a filename in the finder (Os X) only the name is selected. I would like to see Lightroom use the same logic. Thanks!

    Is it because you rename each image individually rather than in a batch ?  I rename all of my images, but I nearly always batch process the entire shoot.  That is very easy to do as you probably already know.  I only occasionally have to rename a single image with a special name.  I click once on the file name and the entire name is highlighted as you mention. Then I double click and only the "meat" of the name without the extension is highlighted.   I didn't have to line the cursor up to the period to get it to do that. This is on a Mac.  I am not sure what would happen on a PC.  It is pretty fast and simple, although I guess the double click would be a pain if I were renaming hundreds of images.  Is there a reason why you are not batch renaming them?  In the old days, photographers would often describe the image in the name ("Oldwhitehouse.jpg" for example).  Now with LR and keywords, that is not really necessary anymore.  Many photographers rename on import with the date/time and sequence number.  All that is necessary is that they have a unique name and then use LR to find them later.
    my 2¢ anyway...
    John
    John G. Blair Studio
    Occidental, California

  • Performing a mass rename on originals to get rid of backslashes in file names. Worked for most files but failed for some with OSSStatus -43. Can't find any info on error -43. Any ideas?

    I'm moving all my managed files to be referenced so I can access from both Aperture and lightroom. Needed to do a rename on 16,000 files to get rid of backslashes in the file names. Most of the time it worked but for 1093 files it gave OSSStatus -43. I've tried googling the error and got nothing. Any ideas where to begin looking?
    Thanks
    Jim

    How are you renaming the files? In the "File > Relocate original file" dialog panel? Are you using a custom name format?
    Have you checked in Aperture, if the originals, that are giving you the error message, are still inside the Aperture library?

  • I cant access firefox, everytime i try i get that windows can't find the file, i tried redownloading it but it still gave me the same message?

    i cant access firefox, everytime i try i get that windows can't find the file, i tried downloading it again but it still gave me the same message. the problem has nothign to do with my internet because it wonks on internet explorer and everythign is fine, my computer just can't access firefox for some reason. i tried uninstallign ti adn then installing it again, but that didnt work, i tried installing a different version and it still didnt work.
    okay the exact message is" Windows cannot find 'C:\Program Files\Mozilla Forefox 4.0 Beta 1\firefox.exe'. make sure you typed the name correctly, and then try again. To search for a file, click the Start button, and then click Search.
    Nothing happens after i install is the "Launch Firefox now" checkbox set, the same message comes up.
    i usually start firefox from the shortcut i have on my desktop but when this happened i thought that the shortcut is the problem, but i went to the Mozilla firefox folder and tried it from there, but it didnt work. i also tried downloading different versions of firefox but that didnt work either.

    can you tell me the solution to "windows cant find firefox" error. thanks.

  • Hi, I cant open a document I have been working on. It has previously been saved without a problem now all I get is a box stating that the file cannot be opened. Any suggestions please?

    Hi, I reecntly purchased a Mac and the Pages App. But now I find that I cant open a document I have been working on. It has previously been saved without a problem now all I get is a box stating that the file cannot be opened. It is visible in both the Pages Windows and under Recent Items but just will not open. Any suggestions please?

    Hi Colourdoodles,
    Maybe the document is corrupted. Can you open other Pages documents? Preview may open it. Right click (or control click) on the document in Finder and Open With > Preview.
    If that works, Edit > Select All, Edit > Copy. Then paste into a blank Pages document. Formatting may be messed up, but you will have editable text. Then Save (with a different name), close and see if you can open the new document.
    Regards,
    Ian

  • Is there a way to have compressor create files without have the settings name as part of the file name?

    It's very annoying to have to delete half of the file name each time.  Is there a way to just have it pop out as whatever you want to title it and the file extension?

    In Compressor 3 - Create a custom destination, where you want to save the compressed files.
    Once it is created, click on the custom destination and look in the Inspector - you will see the Output Filename Template for the destination. Delete the "- Setting Name" so that it just says "Source Media Name".
    Now apply this destination to your clips to be compressed.
    In Compressor 4, I believe the default is just the file name, but you can modify it in the same way by using the inspector for your custom destination when you create a custom destination.
    MtD

Maybe you are looking for

  • Updated my bios, and I had to authorize my computer to play purchased music

    did updating bios (in a dell inspiron 5150) change my Computer's identity or something? Thank goodness I had one spot left of computers to authorize. Is there a way I can make it so this is (again) my primary machine?

  • Database adapter returns result different to SQL

    Hi, I created Database adapter for master-detail select: SELECT DISTINCT t1.INSTANCE_ID, t1.SERVICE_ID, t0.CONFIGURATION_KEY, t0.CONFIGURATION_VALUE, t0.INSTANCE_ID FROM SRVINSTANCECONF t0, SERVICE_INSTANCE t1 WHERE (((t0.CONFIGURATION_KEY = #key) AN

  • AMD Radeon HD5770 with official AMD driver

    Hi all, I just installed Windows 7 64 bit Home Premium on my new 6-core Mac Pro with Boot Camp. So far no problems, except that I can't install the official Catalyst drivers from AMD/ATI's homepage - the installation goes through, however it fails wi

  • Read in a file in UTF-16LE

    hi all, the following code works only on a small UTF-16LE file, but not on a file of say > 100 KB... with such a file the FIRST command isr.read() causes the program to hang...! wrapping with BufferedReader does not solve the prob... InputStreamReade

  • Older app, newer photos..?

    My Paps sent me a CD of photos from a recent trip. I manually put them into my pictures folder and fired up iPhoto. It came up and there was an error message saying: ou cant open your current photo library using this version of iPhoto. You have made