Get a files creation date with UTL_FILE or DBMS_BACKUP_RESTORE.SEARCHFILES

Hello gurus!
I have a number of files in the filesystem and i need to find out the names and creation dates of these files. Please do not suggest Java as that is not an option.
So far i get the names of the files from the SYS side with a procedure that I can call from the user side. The procedure returns an XML string:
create or replace procedure list_directory(directory varchar2, retResultSet OUT VARCHAR2) is
     ns          VARCHAR2(1024);
     v_directory VARCHAR2(1024);
BEGIN
      v_directory := directory;
      SYS.DBMS_BACKUP_RESTORE.SEARCHFILES(v_directory, ns);
      retResultSet := '<list>';
      FOR each_file IN (SELECT fname_krbmsft AS name FROM x$krbmsft) LOOP
          --DBMS_OUTPUT.PUT_LINE(each_file.name);
          retResultSet := retResultSet  || '<file>' ||each_file.name|| '</file>';
      END LOOP;
      retResultSet := retResultSet || '</list>';
end list_directory;Question 1:
Something like each_file.creation_date would be perfect but it seems like the filename is the only attribute available here from x$krbmsft. Am i wrong? Any other way on the SYS side to get the date?
Question 2:
On the users side i could use UTL_FILE to get filesize but not much more valuable information. Can i get the creation date somehow with UTL_FILE or similar?
Any help is appreciated!

Anyone got any ideas?Maybe a method as described in Re: Read all file names from Directory. may help (Shows also FileCreationDate).

Similar Messages

  • Get the file creation date

    hi friends..
    i searched many forums to get file creation date
    i didnt get the solution but i found one program which execute
    dos command and gets the output of that.
    so using that program i developed a program to get the file creation Date & Time also
    //getCreationDate.java
    import java.io.*;
    import java.lang.*;
    public class getCreationDate {
    public static void main (String args[]){
      try {
         // get runtime environment and execute child process
         Runtime systemShell = Runtime.getRuntime();
          BufferedReader br1=new BufferedReader(new InputStreamReader(System.in));
          System.out.println("Enter filename: ");
          String fname=(String)br1.readLine();
         Process output = systemShell.exec("cmd /c dir "+fname);
           // open reader to get output from process
         BufferedReader br = new BufferedReader (new InputStreamReader(output.getInputStream()));
         String out="";
          String line = null;
          int step=1;
          while((line = br.readLine()) != null )
                if(step==6)
               out=line;
                step++;
                }          // display process output
          try{
          out=out.replaceAll(" ","");
          System.out.println("CreationDate: "+out.substring(0,10));
          System.out.println("CreationTime: "+out.substring(10,16)+"m");
          catch(StringIndexOutOfBoundsException se)
               System.out.println("File not found");
       catch (IOException ioe){ System.err.println(ioe); }
       catch (Throwable t) { t.printStackTrace();}
    }

    Following line should be modified to make it work on all platforms:
    Process output = systemShell.exec("cmd /c dir "+fname);

  • How can I get the File Creation Date OR Last modification date of the incoming file in my message?

    I need the Last Modification Date and the File creation date of the consumed file in my message, is it possible to do that using a custom pipeline component in decode stage or any other way? The FILE namespace have File creation time that actually gives
    the time the file was dropped in receive location, not the actual creation time. Also this namespace doesn't have the Last Modification Date.

    Yes,
    As per MSDN, "File.FileCreationTime" - "Defines the time that the file was written to the folder that is monitored by the File receive
    adapter."
    So for File Modified DateTime, only option I can think of is create a custom file adapter (updating the File Adapter code from SDK ..\SDK\Samples\AdaptersDevelopment\File Adapter) and access the received file with the code something like the following, which
    you give you the Last Modified date
    string sLastModifiedDate = File.GetLastWriteTime(path).ToString();
    If there are any business requirements which drives you this, then this the only way I can think of. Because you can access the file properties only in adapter, when it passes through adapter file is handled as stream and you will only have context properties
    to access the file related properties.
    If you're looking for implement this for any audit purpose or for your any technical purpose, then you can suggest some alternate than using File updated datetime.
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • To get the file creation date

    Hi All,
            Can anyone tell me how to get the creation date of a file in SAP Directory.
      Is there any function module to do so.
    Thank You.

    I don't believe one exists. You may need to do a JNI call to get this.

  • Creating folders based on file creation date

    Hi,
    I have a folder full of images and I am looking for an Automator workflow/app/script that can look at the files sequentially, read the creation date and then create folder name based on the file creation date (Year-Day-Month). Then move the file to the respective folder.
    Appreciate any input you can provide.
    Regards
    Tom Erik

    Open the AppleScript Editor in the /Applications/Utilities/ folder and run:
    tell application "Finder"
    repeat with this_file in (get files of window 1)
    set the_date to creation date of this_file
    set folder_name to ((year of the_date as string) & "-" & day of the_date & "-" & month of the_date)
    try
    make new folder in window 1 with properties {name:folder_name}
    end try
    move this_file to folder folder_name
    end repeat
    end tell
    (75533)

  • How can I change the file creation date?

    I recently downloaded more than 1,000 photos from my vacation. I'm preparing to burn DVDs for a friend, and I noticed that when I copy the photos to the desktop, they don't all have the same date. I have read a couple of discussions here about the difference between photo creation date and file creation date, and I understand the difference. But something seems odd to me.
    For purposes of illustration, let's take two photos: "A" was taken with the camera in the landscape position (how one normally holds a point-and-shoot); "B" was taken with the camera held in the portrait position (rotated 90 degrees). The photos were taken on April 24, about three minutes apart, but not imported into iPhoto until May 19.
    In iPhoto, both files show the actual creation date. Yay!
    The problem is with the files after having been copied to the desktop.
    When copied to the desktop, the info panel for photo "A" shows April 24 for both the "created" and "modified" dates. Photo "B," however, shows May 19 for the "created" and "modified" dates.
    Apparently, when the "B-style" photos were imported into iPhoto, the app automatically rotated them so that they are viewed correctly (without having to turn your head sideways). This is a very nice feature, but the result is that the file date changes.
    Is there any way to change this? I want the DVD to show the date the photo was created, not imported to iPhoto. Picky, I know … but I'm like that. 

    Apparently, when the "B-style" photos were imported into iPhoto, the app automatically rotated them so that they are viewed correctly (without having to turn your head sideways). This is a very nice feature, but the result is that the file date changes.
    Correct.  Your camera has an Auto-Rotate feature. However, the camera does not actually rotate any pixels in the file, but instead flags it with an instruction: "Display me this way". This is a tag in the Exif metadata. When you import a file with this tag iPhoto creates a modified version. It does this because most of the apps that integrate with it -  email clients, word processors etc - simply don't understand this Exif tag. So if you used the shot in a word processing doc, uploaded it to many Web site etc, the shot would come out sideways.
    iPhoto has nothing to say about File dates. There are various file utilities that will edit the dates on Files
    http://www.macupdate.com/app/mac/11143/a-better-finder-attributes
    for instance. But there are otheers, search on  MacUpdate
    Regards
    TD

  • IPhoto file creation date inconsistencies during drag and drop

    I have noticed that if I drag and drop a photo from iPhoto to Finder, the file creation dates in Finder are inconsistent.
    (This question is related to drag and drop only and not File->Export, which always uses the export date and timestamp for the file creation date and thus does not suit my needs).
    TEST A -- If the EXIF DateTimeOriginated is 01/01/2013, and today's date is 03/03/2013, then:
    In some cases when I drag a file to Finder, the EXIF date is used as the file modification/creation date in Finder
    In some cases, today's date is used as the file modification/creation date in Finder
    In some cases, a date in between the EXIF date and today's date is used
    It appears that for case A1, these are files that do not have a modified copy.  That is, if you select the photo in iPhoto and then click "File" -> "Reveal In Finder", the "Modified File" choice will be greyed out.
    For cases A2 & A3, iPhoto has inexplicably decided to create modified versions of these files either today or sometime in the past.
    TEST B -- I have read that unexplained modifications are tied to the auto-rotate function in cameras, and it does seem to be the case when I performed the test below:
    Select a large group of landscape format photos (these would not have been auto-rotated), then drag and drop to Finder.  The file creation dates are set to the EXIF date
    Add some portrait photos to the group in (1).  Now the file creation date of ALL photos including the non auto-rotated photos are set to the current date
    The behaviour in B2 is clearly wrong, since the landscape photos should be the same as in B1.  This is bug #1.
    Furthermore, iPhoto appears to be inconsistent with when these modifications are made.  For example, I dragged & dropped an auto-rotated photo on 02/02/2013, then dragged & dropped it again today, then the file creation date in Finder (and also the date of the modified file in iPhoto, as shown in iPhoto File->Reveal In Finder->Modified File) can either the EXIF date (01/01/2013), the late of the last drag & drop (02/02/2013), or today's date (03/03/2013); there does not appear to be any rhyme or reason to this.  This is bug #2.
    In any case, saying "you should never use drag & drop in iPhoto" (as I have read in some other forum posts) isn't a solution, because Apple should either (a) support this function correctly or (b) remove it altogether.  Furthermore, I regularly burn photos to disk for others so having the file date and timestamps correctly set to the EXIF date helps keeping the photos sorted in the directory listings for multiple OS, so File->Export isn't a solution.

    File data is file data. Exif is photo data. A file is not a photo.  It's a container for a photo.
    When you export you're not exporting a file. You're exporting a Photo. The medium of export is a new file. That file is created at the time of export, so that's its creation date. The Photo within that file is dated by the Exif.
    There are apps that will modify the file date to match the Exif.
    The variation you're seeing is likely due to the changes in how the iPhoto library works over the past few versions. Drag and drop is handy, but is not a substitute for exporting, nor intended to be.

  • How to import Filenames and File creation Date into Table..

    Hi Folks,
    I am importing Differennt Excels Files into table. my require ment is after importing completed I need to insert all these Filenames ,File creation date into table. (for Auditing).
    Can you please give me any ideas or reference link.  Thanks In Advance.

    Hi Folks,
    I am importing Differennt Excels Files into table. my require ment is after importing completed I need to insert all these Filenames ,File creation date into table. (for Auditing).
    Can you please give me any ideas or reference link.  Thanks In Advance.
    You can also prepare dir command and then exeucte it by using XP_CMDSHELL. This gives you file name, modified date, creation date information.
    Please refer:
    https://sqljourney.wordpress.com/2010/06/08/get-list-of-files-from-a-windows-directory-to-sql-server/
    https://hernandezpaul.wordpress.com/2013/02/15/store-file-names-and-modified-dates-in-a-table-without-a-foreach-loop-task-sql-server-ssis/
    Cheers,
    Vaibhav Chaudhari
    [MCP],
    [MCTS], [MCSA-SQL2012]

  • How can we get Dynamic columns and data with RTF Templates in BI Publisher

    How can we get Dynamic columns and data with RTf Templates.
    My requirement is :
    create table xxinv_item_pei_taginfo(item_id number,
    Organization_id number,
    item varchar2(4000),
    record_type varchar2(4000),
    record_value CLOB,
    State varchar2(4000));
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'USES','fever','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'HOW TO USE','one tablet daily','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'SIDE EFFECTS','XYZ','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'DRUG INTERACTION','ABC','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'OVERDOSE','Go and see doctor','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'NOTES','Take after meal','TX');
    select * from xxinv_item_pei_taginfo;
    Item id Org Id Item Record_type Record_value State
    493991     224     1265-D30     USES     fever     TX
    493991     224     1265-D30     HOW TO USE     one tablet daily     TX
    493991     224     1265-D30     SIDE EFFECTS     XYZ     TX
    493991     224     1265-D30     DRUG INTERACTION     ABC     TX
    493991     224     1265-D30     OVERDOSE      Go and see doctor     TX
    493991     224     1265-D30     NOTES     Take after meal     TX
    Above is my data
    I have to fetch the record_type from a lookup where I can have any of the record type, sometime USES, HOW TO USE, SIDE EFFECTS and sometimes some other set of record types
    In my report I have to get these record typpes as field name dynamically whichever is available in that lookup and record values against them.
    its a BI Publisher report.
    please suggest

    if you have data in db then you can create xml with needed structure
    and so you can create bip report
    do you have errors or .... ?

  • How can you determine a file creation date and know if it's been altered since the creation date

    I need to know how to determine a file creation date on an ipad.  If someone creates a document/note on an ipad how can you tell when it was created and if it has been altered since?

    Unless you are using a third party app that provides that functionality, in iOS the only thing youcan access is the last edit/save date and time, which is fairly evident in the user interface for documents and notes. Some apps that handle MS Office files may provide that, but ican't say first hand.

  • FM "GUI_UPLOAD " File type 'DAT' with UNICODE

    Hi all,
            We’re using UNICODE  and we have developed a FM  which upload the data from application server as well as  from presentation server. Its based on selection screen options.  We are using GUI_UPLOAD FM in our function module. We have hardcode file type as ‘DAT’.
    CALL FUNCTION 'GUI_UPLOAD'
          EXPORTING
            FILENAME                = Z_FILENAME
            FILETYPE                = 'DAT'
            HAS_FIELD_SEPARATOR     = 'X'
          TABLES
            DATA_TAB                = T_INPUT
    But when we’re uploading file from presentation server as CSV, Tab delimited or even XLS .its giving an error. Why is that? Is this any thing to do with UNICODE? What should be the type of file DAT?
    Please give your suggestions/input.
    Thanks
    Bye

    "subrc = 5 "
    INVALID_TYPE            = 5
    Why We cant user file type 'DAT' with GUI_UPLOAD ?
    I’m defining the structure as per file and rests of things are fine.
    Thanks for the reply...!
    <b>GUI_UPLOAD  HELP !!!</b>
    Value range
    <b>'DAT'</b>
      The components of the internal table are filled from the file. If the table contains several columns, the entries in the file must be separated by tabs. No conversion exits are carried out.
    The following applies for the different data types:
    I or N or P or F
    The numbers must be formatted according to the decimal representation defined in the user settings.
    D The date must be defined according to the date format defined in the user settings.
    T The time must have the format hh:mm:ss.
    Message was edited by: Suleman Javed

  • How can I get avi files to work with imovie08?

    Hi I bought a macbook last year and have loved creating imovie videos by simply using the video function on my digital camera. My daughter was born last year and we have a great collection of clips of her first 7 months. I'd now like to take things a step further and put together a wedding video.
    We had our wedding day filmed on a digital camcorder by a friend and he has given my 25MB of avi files which I would like to import into imovie and make into a video however I understand that this format isn't compatible. Is there a way of getting it to work and if so please can you tell me in very simple terms what I need to do to get the files to work with imovie? (I'm not very technical)
    Thanks
    Matt

    I do not know of a way to import .avi files directly into iMovie, and I am positive that this is not actually possible as iMovie only supports the importation of .mov, .mp4 (mpeg4) and .dv filetypes.
    What you could do is use a video converter (there are some good ones that are availible free, eg MPEG Streamclip (http://www.apple.com/downloads/macosx/video/mpegstreamclip.html)) to convert those avi movie files to either of the 3 video formats iMovie supports, then import them.
    MPEG Streamclip does sound a little complicated for you but it is the best I have found, any more questions just post them here.

  • How do I get mp3 files to appear with album cover thumbnails?

    how do I get mp3 files to appear with album cover thumbnails? when I updated my ITunes now all my mp3 files
    that had thumbs have no thumbs...thanks

    First, you have to embbed picture into mp3 file with idtag editors (tagalicious, musicbrainz picard, mp3tag, id3tag editor...).
    Then you'll have to install at least Itunes 10.5.1(42), even if you're not using Itunes at all.
    Albumarts will now appear in every folder from the finder.
    I closed my topic because I solved it :
    https://discussions.apple.com/message/16640910
    Is it the same for you ?

  • Get original file creation and modified date during upload - ONLY in explorerview ??

    Hi,
    SharePoint and me are having a difficult time again ;-)
    I have the customer requirement to retain the original file's creation date and modified date.
    Please do not start replying by just pasting links that you might find while searching for the keywords "retain creation date".
    In a nutshell I found out that the original dates are only available in SharePoint if the
    explorerview has been used. I always thought that the explorerview is a bad thing, but only here - the original creation date is stored in a property called "vti_ct". In the itemupdated eventreceiver you can get the
    value and work with it.
    Complete list of available properties
    http://sbrickey.com/Tech/Blog/Post/Secrets_Revealed_SP_Event_Receivers_firing_multiple_times
    Here I found the hint with the explorerview
    http://answers.flyppdevportal.com/categories/sharepoint2010/sharepoint2010programming.aspx?ID=57bfd5f5-941f-4a89-919d-cdf7b0b801be
    It is only available in the 2nd loop of the itemupdated event. 
    How the f*** can this happen??? The 2nd post states that when using the explorerview the file is being copied, while it is being re-created by using the SharePoint UI.
    Has anyone a different approach for using the SharePoint UI?
    I thought about different approaches for this issue. From my perspective it seems to be not solvable from the server-side. It seems only to be able to be set using a client application.
    Example 1: spbulkdocumentimport 
    http://spbulkdocumentimport.codeplex.com/wikipage?title=Features&referringTitle=Documentation
    Example 2: implement a custom webservice
    http://blog.orbitone.com/post/Preserve-created-and-modified-information-when-importing-a-document-in-SharePoint
    How do you deal with this customer requirement?
    Open for discussions
    Sven 

    Hi,
    Newbie to SharePoint, learn quite a lot from the links you provided.
    “I found out that the original dates are only available in SharePoint if the explorerview has been used”, this would make sense because the original creation time is generated
    by the file system in the local machine.
    However, when a file is uploaded to SharePoint library, it will be stored as binary data in the database, as well as the newly created time. It means that it will be a “new” file
    in the SharePoint site regardless of where it comes from.
    Per my knowledge, the only way I can suggest is that you will need to create a client desktop application for the file uploading, which will be a more general way not only for
    uploading a file, but also when we need to migrate files between different systems.
    Thanks

  • Applescript for matching two files creation date

    Hello,
    I reopen here a question that I posted on another forum (macrumors):
    I have converted almost 1,000 video files from MPG1 to MOV in order importing them to Final Cut Pro (FCP can't import directly MPG1!).
    So I have TWO folders:
    Folder 1 with the original VideoXXXX.mpg1 files
    Folder 2 the converted VideoXXXX.mov files.
    The file names on both folders are the same. And the number of files in the two folders are the same.
    My problem is that the creation date of files in the Folder 2 is the "conversion" time (July 2012) instead the original creation time (from 2005 to 2010).
    When imported to FCP, I need the creation time. The name doesn't include the time, so I don't know the file date looking only at the file name.
    I need an Apple Script for changing the creation date to the files in Folder 2 files matching the creation date on the Folder 1 files.
    - For file n on Folder 1, take name and creation date
    - Look for the same file name on Folder 2
    - Set creation date of file on Folder 2 to Creation date of original file
    I have seen that it can be made with the "touch" command, but I'm new to applescripting and any help would be very appreciated!!
    Thanks

    Wooow...
    How many helping responses! Thanks to you all.
    I am trying the first sugested solution.
    I have tried adding "file" to theOriginalFile twtwtw script.
    (name of file theOriginalFile)
    But the error persists (I changed -5 to -4, as the extension is only MPG)
    tell application "System Events"
      get POSIX path of every file of folder "HD Mac:users:fhuet:Desktop:Vid1" whose name extension = "MPG"
      --> {"/Users/fhuet/Desktop/Vid1/MOV04859.MPG", "/Users/fhuet/Desktop/Vid1/MOV04860.MPG", "/Users/fhuet/Desktop/Vid1/MOV04882.MPG", "/Users/fhuet/Desktop/Vid1/MOV04905.MPG", "/Users/fhuet/Desktop/Vid1/MOV04906.MPG"}
      get creation date of file "/Users/fhuet/Desktop/Vid1/MOV04859.MPG"
      --> date "viernes, 31 de diciembre de 2004 23:39:00"
      get text 1 thru -4 of name of file "/Users/fhuet/Desktop/Vid1/MOV04859.MPG"
      --> error number -1720 from text 1 thru -4 of name of file "/Users/fhuet/Desktop/Vid1/MOV04859.MPG"
    Resultado:
    error "System Events ha detectado un error: Espectro no válido." number -1720 from text 1 thru -4 of name of file "/Users/fhuet/Desktop/Vid1/MOV04859.MPG"
    If I do
    set strippedFileName to name of file theOriginalFile
    I got:
    tell application "System Events"
      get POSIX path of every file of folder "HD Mac:users:fhuet:Desktop:Vid1" whose name extension = "MPG"
      --> {"/Users/fhuet/Desktop/Vid1/MOV04859.MPG", "/Users/fhuet/Desktop/Vid1/MOV04860.MPG", "/Users/fhuet/Desktop/Vid1/MOV04882.MPG", "/Users/fhuet/Desktop/Vid1/MOV04905.MPG", "/Users/fhuet/Desktop/Vid1/MOV04906.MPG"}
      get creation date of file "/Users/fhuet/Desktop/Vid1/MOV04859.MPG"
      --> date "viernes, 31 de diciembre de 2004 23:39:00"
      get name of file "/Users/fhuet/Desktop/Vid1/MOV04859.MPG"
      --> "MOV04859.MPG"
    So it's OK. After that, obviously, it gives another error.
    So, the problem is with the instruction
    set strippedFileName to text 1 thru -4 of (name of file theOriginalFile). There must be a sintaxis error on that. It says "ESPECTRO NO VALIDO" ERROR
    I keep trying and will try the other options.
    But I'd like to test all of them, as it's the best way to well understand and study the lenguage.
    Thanks again.

Maybe you are looking for

  • Creating Job Issue

    Hi Experts, I have created a page in Apex where I m using File browse item say :p13_filebrowse(where i m using CSV format files) and other items too. On click of Submit button I m calling package which dynamically creates the table successfully of br

  • Field selection for mvt type.

    Hi, Iam receiving an error message while doing Post Goods Issue in Inter company stock transfer in the delivery(VL02N). ' Field selection 643 mvt type/ 400020 differs with business area (033).' Help me out in this problem.

  • Changes in Windows 8.1 Basic w.r.t COM security

    Hello, In Windows 8.1 Basic edition, our COM server is crashing frequently. These crash issues does not occur on Windows 8.1 professional. Is it due to any missing components or features or any changes in COM security settings? Is it linked to UAC? O

  • Link field in Properties bar "sticks"?

    I'm using Dreamweaver CS6 on Mac OS X 10.8.2. I've been trying to select some text in Design view that has a link; then copy the text of the link from the Link field in the Properties bar; then select another bit of text and paste the url into the li

  • HT201320 Can't find my sent e-mail messages

    Hello All- I have my e-mail set up, but, I cannot see my outbox, or drafts, only my inbox. Thanks, Dee Anna