Retrieve the date a file was created in the background

EDITED CONTENT----
Apologies all...I just realized there is a specific forum for this type of question.  I will post it there.
Thanks Marilyn for point this out>>>>should have read it first as suggested. 
/message/2572763#2572763 [original link is broken]
Hi guru's,
I have a custom application that does some windows directory cleaning based an older than 'X' days setting.  I have to do some calculation to determine if the file being processed is older than that number of day and delete it if it is.  To determine the file created date I use the method DIRECTORY_LIST_FILES from CL_GUI_FRONTEND_SERVICES.  This works great in the foreground but dumps in the background because the handle object reference is not created in the class constructor and subsequently does a call to a "NULL" object.
My question:
Does anyone know of a way to get the date a file was created while running in the background?  If not, please read on --- I have another question regarding an alternate approach I am trying.
I have tried the following approach FM EPS_GET_DIRECTORY_LISTING to return an internal table with all files in a directory.  Works fine in the background, but the created date is not in the return values.  Soooooo I looped at the internal table and called this system function:
        CALL 'C_FILE_ATTRIBUTES'
            ID 'NAME'     FIELD tempfile
            ID 'TYPE'     FIELD singleFile-
            ID 'LEN'      FIELD file-len
            ID 'OWNER'    FIELD file-owner
            ID 'MTIME'    FIELD file-mtime
            ID 'MODE'     FIELD file-mode
            ID 'ERRNO'    FIELD file-errno
            ID 'ERRMSG'   FIELD file-errmsg.
This returns the MTime, which is the Modified time (in Epoch time format: number of seconds since Midnight 1 January 1970), but no created time.  Does anyone know the ID for the created time?  I tried CTIME but no value is returned. 
Along with this question: any idea if a FM or Method exists to convert Epoch time to a standard time.  I could do the calculation myself....but it seems someone would have already done this.  No point in re-creating the wheel.
Thanks so much,
Quack
Message was edited by:
        Ryan Quackenboss

I will be happy to.
Please post something to this thread. 
Retrieve the date a file was created in the background
I UNMARKED this question as a post and reposted in the data transfer forum.
That post is still open.  Once you post there, I will mark it ANSWERED and award points.
Thanks for the help
Quack

Similar Messages

  • " Can not interpret the data in file " error while uploading the data in DB

    Dear All ,
    After running the below report I am getting the " Can not interpret the data in file " error.
    Need to upload the data in DB through excel or .txt file.
    Kindly advise to resolve the issue.
    REPORT  ZTEST_4.
    data : it like ZPRINT_LOC occurs 0 with header line,
    FILETABLE type table of FILE_TABLE,
    wa_filetable like line of filetable,
    wa_filename type string,
    rc type i.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
    CHANGING
    FILE_TABLE = filetable
    RC = rc.
    IF SY-SUBRC = 0.
    read table filetable into wa_filetable index 1.
    move wa_filetable-FILENAME to wa_filename.
    Else.
    Write: / 'HI'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    start-of-selection.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    FILENAME = wa_filename
    FILETYPE = 'ASC'
    HAS_FIELD_SEPARATOR = 'X'
    TABLES
    DATA_TAB = it.
    IF SY-SUBRC = 0.
    Write: / 'HI'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    insert ZPRINT_LOC from table it.
    if sy-subrc = 0.
    commit work.
    else.
    rollback work.
    endif.
    Regards
    Machindra Patade
    Edited by: Machindra Patade on Apr 9, 2010 1:34 PM

    Dear dedeepya reddy,
    Not able to upload the excel but have sucess to upload the .csv file to db through the below code. Thanks for your advise.
    REPORT  ZTEST_3.
             internal table declaration
    DATA: itab TYPE STANDARD TABLE OF ZPRINT_LOC,
          wa LIKE LINE OF itab,
          wa1 like line of itab.
                       variable  declaration
    DATA: v_excel_string(2000) TYPE c,
           v_file LIKE v_excel_string VALUE    'C:\Documents and Settings\devadm\Desktop\test.csv',  " name of the file
            delimiter TYPE c VALUE ' '.         " delimiter with default value space
         read the file from the application server
      OPEN DATASET v_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc NE 0.
    write:/ 'error opening file'.
      ELSE.
        WHILE ( sy-subrc EQ 0 ).
          READ DATASET v_file INTO wa.
          IF NOT wa IS INITIAL.
            append wa TO itab.
          ENDIF.
          CLEAR wa.
        ENDWHILE.
      ENDIF.
    CLOSE DATASET v_file.
    EXEC SQL.
         TRUNCATE TABLE "ZPRINT_LOC"
    ENDEXEC.
    *------display the data from the internal table
    LOOP AT itab into wa1.
    WRITE:/ wa1-mandt,wa1-zloc_code,wa1-zloc_desc,wa1-zloc,wa1-zstate.
    ENDLOOP.
    insert ZPRINT_LOC from table itab.

  • My Mac crashed.  Can I retrieve the data somewhere that was entered before the crash?

    I use numbers to organize all of my work.  I hadn't saved the new information for about a day and a half and my Mac crashed.  That's never happened before.  When i restarted the computer, all of the new data that was entered since the last save was gone.  Is there a way to get that information back?  Isn't there an "autosave" on numbers?  I just feel like I haven't looked in the right place.  I pretty much NEED this info to do my job today and I'm trying not to flip out.  Can someone please help???

    I hope that now you will understand that computers aren't perfect tools and that if you don't take care to save your work from time to time, the chance to loose it is not null.
    If you are unable to press cmd + s by yourself every ten minutes, you may
    go to my iDisk :
    <http://public.me.com/koenigyvan>
    Download :
    for_iWork:autoSave_iWork.zip
    Expand it and install the resulting application.
    Yvan KOENIG (VALLAURIS, France) 12 mai 2011 15:03:24

  • Cant get list of files from a folder (even though the folder and files are created with the same app)

    Ok so each character rolled with my app gets saved as an html file in a folder i create on the sdcard called RpgApp
    the code to do this is 
    private async Task saveToHtmlCharacter(string name)
    StorageFolder externalDevices = Windows.Storage.KnownFolders.RemovableDevices;
    StorageFolder sdcard = (await externalDevices.GetFoldersAsync()).FirstOrDefault(); //Windows.Storage.ApplicationData.Current.LocalFolder;
    var dataFolder = await sdcard.CreateFolderAsync("RpgApp",
    CreationCollisionOption.OpenIfExists);
    var file = await dataFolder.CreateFileAsync(name+".html",
    CreationCollisionOption.ReplaceExisting);
    using (StreamWriter writer = new StreamWriter(await file.OpenStreamForWriteAsync()))
    writer.WriteLine("<html><head><title>Character File for " + z.charNameFirst + " " + z.charNameSecond + "</title></head><body>");
    //trimed for the post
    now this as i say works perfectly and i can confirm that the files show up in the "RpgApp"folder
    now the next step is to have the app read the names of each of those html files and create a seperate button for each one named for the filename and with the filename as content (later i will link them up to load the html file they are named for in a webbrowser
    panal)
    here is the code that *should* do that
    private async Task readFiles()
    z.test.Clear();
    StorageFolder externalDevices = Windows.Storage.KnownFolders.RemovableDevices;
    StorageFolder folder = (await externalDevices.GetFolderAsync("RpgApp"));
    IReadOnlyList<StorageFile> fileList = await folder.GetFilesAsync();
    //z.test.Add("dummy");
    foreach (StorageFile file in fileList)
    z.test.Add(file.Name);
    public async void buttonTest()
    await readFiles();
    CoreDispatcher dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
    await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
    foreach (string name in z.test)
    Button button1 = new Button();
    button1.Height = 75;
    button1.Content = name;
    button1.Name = name;
    testStackPanal.Children.Add(button1);
    now i say should as what i get is an error of "A first chance exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.ni.dll" (2 of them in fact one after another)
    more detailed error is at http://pastebin.com/3hBaZLQ9
    now i went through checking line after line to find the error and line that causes it is:
    StorageFolder folder = (await externalDevices.GetFolderAsync("RpgApp"));
    in the readFiles method
    i checked to make sure the case is right etc and its spot on, that IS the folder name, and remember my app creates that folder and creates the files that are inside that folder (and only files my app creates are in that folder) so it should have access
    im 100% stuck its taken me all day to get the files to save and now i cant get them to list correctly
    I have tested the button creation function with fake list data and that worked fine, as i say the error is when i tell it to look at the folder it created
    all help most greatfully recieved

    this was actually solved for me on another forum thread 
    async Task<bool> continueToReadAllFiles(StorageFolder folder)
    if (folder == null)
    return false;
    if (folder.Name.Equals("RpgApp", StringComparison.CurrentCultureIgnoreCase))
    var files = await folder.GetFilesAsync();
    foreach (var file in files)
    test.Add(file.Name);
    return false;
    var folders = await folder.GetFoldersAsync();
    foreach (var child in folders)
    if (!await continueToReadAllFiles(child))
    return false;
    return true;
    public async void buttonTest()
    test.Clear();
    StorageFolder externalDevices = Windows.Storage.KnownFolders.RemovableDevices;
    var folders = await externalDevices.GetFoldersAsync();
    foreach (var folder in folders)
    if (!await continueToReadAllFiles(folder))
    break;
    //.... commented out
    ...now i say solved this is more a workaround...but it works.
    I would love to know why we cant just scan the RpgApp folder instead of having to scan the whole dc card and disregard all thats not in the RpgApp folder

  • Method to get date file was created?

    I don't see a method for this in class File. I can get lastModified() but I don't see a way to get the date the file was created. Any ideas?
    Thx.

    You'd need to resort to a JNI call, this is too OS specific. The date of creation is not available on e.g. UNIX operating systems.

  • Set Adobe Acrobat XI Pro. When I want to save the file in WORD, EXCEL or esporta file into ... immediately throws an error "save as failed to process this document no file was created". What's the problem?

    Set Adobe Acrobat XI Pro. When I want to save the file in WORD, EXCEL or esporta file into ... immediately throws an error "save as failed to process this document no file was created".
    What's the problem?
    Any help in finding a solution is greatly appreciated.
    Thank you,

    Installed AcrobatXI PRO 11.0.09  on seven computers and laptops. Two of them gives an error when you try to save a document in WORD, EXCEL, Power Point, or when exporting to... error: Save failed to process this document. No File was created.
    But all good saves in the format of TXT and jpg.
    I have uninstalled and restored and re-installed and updated and registry cleaned and removed using the special utility Cleaner Tool for Acrobat, but nothing helps.
    On one notebook with Windows 8.1 and Microsoft office 2013, on another laptop with Windows 7 and Microsoft office 2010, the same problem, although there are computers with Windows 7 and Microsoft office 2010 and everything works.
    Tell me where to find the problem and how to solve it.
    Thank you.

  • I am facing issue when opening flash files in Flash CC. (error:- This file was created with a later release of Flash Professional and might contain new features that would be lost when saved in the current format.)

    I am facing issue when opening flash files in Flash CC. (error:- This file was created with a later release of Flash Professional and might contain new features that would be lost when saved in the current format.)

    Wow. Okay...
    I'll let the real veterans in this forum tackle your issues one after the other. But, I can tell you, all will be well.
    My only comment would be re: your computer specs:
    BJReis wrote:
    .  This may be due to somewhat older equipment:
    GHz Intel Core Duo MacBook Pro with a 4GB memory computer with Ddr3 running OSX 10.8.4
    To be completely honest, FCPX is a RAM hog. It just is. But, RAM is relatively cheap, and the pay-off is good.
    4GB is right on the edge, IMHO. 16G is ideal.
    I wish you luck, hang in there, and standby for more help.

  • When converting a .pptx file of 6MB to .pdf, the file size ballooned to 25MB. The original file was created on a PC. What happened? Why? How to fix? Thx.

    When converting a .pptx file of 6MB to .pdf, the file size ballooned to 25MB. The original file was created on a PC. What happened? Why? How to fix? Thx.

    gssharpe wrote:
    What happened?
    Nothing much. Different formats.
    How to fix?
    Try editing the original file. Resample pics to a lower resolution, check out other graphics, check table borders (eliminate any dotted lines or borders), check font usage. When generating PDF, try Save As (instead of Print > Save As), although I don't expect that'll make much difference.
    Next, open the PDF in Preview, choose File > Save As, choose Format: PDF, Quartz Filterz: Reduce File Size. If that isn't enough, you can use ColorSync Utility to duplicate the Reduce File Size filter, and then edit it for a more aggressive size reduction. But keep in mind that size reduction means lower quality.

  • When creating PDF I get message "This file was saved to the Temporary Internet  Files Folder"

    about 80% of the time when I am creating a PDF Document using the Print to Adobe function I get the following message:
    "For your computers security, this file was saved to the Temporary Internet Files folder"
    "Do you want to open this folder?"
    It doesn't matter if I say yes I want to open the folder or not I can never locate the file.
    I am using Vista Ultimate 32. for an operating system.
    I have the following programs installed too:
    Office 2007 Enterprise
    Office 2007 Project Professional
    Office Visio Professional 2007
    As a antivirus I am using Trend Micro Internet Security Pro 2008
    Diskeeper 2008 Pro
    Nero 8
    Quicken Home and Business 2008
    WinRar
    I am using Microsoft Internet explorer V 7.0.6001.18000
    Thank you for your help. I have looked everywhere and I'm lost.

    You can get the same results (as turning protected mode off) by:
    (presuming you have an icon for Internet Explorer on your desktop or taskbar) -- right click the icon and pick "Run as administrator"
    I've got the same problem printing to pdf (Acrobat v8; problem's only in IE7) on a Dell Optiplex/Vista Business desktop machine (though not my T61/Vista Ultimate Thinkpad laptop) and the above resolves the issue for my desktop machine. Certainly not a fix but perhaps a clue to Adobe developers, on the [slim?] chance they read these posts.

  • Convert an integer value that was created with the Excel DATEVALUE formula to a valid date?

    Hello everyone,
    How can I convert an integer value that was created with the Excel DATEVALUE formula to a valid date in SSIS?
    Is this even possible?
    For example:
    =DATEVALUE("8/22/2008") will format the cell to display 39682.
    Reading the column as a string to get the int value (39682) - how can I turn this into a valid date using SSIS and then importing the real date to sql server?
    Thank you!

    You can use Script component for this and convert your integer values to Date. An example here is following:
    CultureInfo provider = CultureInfo.InvariantCulture;
    string dateString = "08082010";
    string format = "MMddyyyy";
    DateTime result = DateTime.ParseExact(dateString, format, provider);
    Source: http://stackoverflow.com/questions/2441405/converting-8-digit-number-to-datetime-type
    Vikash Kumar Singh || www.singhvikash.in

  • Hello! Can't open an IDML file. ID file was created in CC (10). It is a 100 page (50 spreads) doc that is one big table. It was created in CC (10) and saved as an IDML file. I have CS6 and when I try to open it, it shuts down ID almost instantly. The file

    Hello! Can't open an IDML file. ID file was created in CC (10). It is a 100 page (50 spreads) doc that is one big table. It was created in CC (10) and saved as an IDML file. I have CS6 and when I try to open it, it shuts down ID almost instantly. The file was created on a MAC and I am trying to open it on a MAC. Any/all advice is greatly appreciated as I am up against a deadline with this unopened file! Many thanks in advance, Diane

    There's a good chance the file is corrupt. As whomever sent it to you to verify it opens on their end.

  • HT4075 I don't have any problems merging the documents by dragging, but when I try to save and open afterwards, only the last shown doc was saved, not the combined files I wanted to merge. I tried save and export, how can I create the file after merging?

    Hi, I'm having trouble saving the documents when merging in Preview. I don't have any problems merging the pdf documents by dragging them in preview, but when I try to save and open afterwards, only the last shown doc was saved, not the combined files I wanted to merge. I've tried save and export, but none merge the documents after saving... how can I create the file (with all the pdf files) after merging?

    That's a comment in the file. It has no effect at all.

  • Run big report in PDF hangs though the PDF file was created in server

    When running Oracle reports6i big master-details-details report(220 pages) in PDF format thru report server CGI on Netscape Enterprise Web server, it hangs. But the pdf file was created when checking in the server and is good when it's viewed directly using IE. Also checked the http://domain_name:8083/cgi-bin/reportcgi/showjobs?server=repsrv, the Job Status was 'FINISHED'.
    The HTTP_error_Log in the server is:
    [17/Feb/2004:13:31:42] failure (28995): for host 63.237.37.70 trying to POST /cgi-bin/reportcgi, cgieng_scan_headers reports: the CGI program /usr/netscape/elecprod/cgi-bin/reportcgi did not produce a valid header (read failed, error is Resource temporarily unavailable).
    Please help as our users demand it urgently.
    Thanks a lot.

    1) This bug734197 is fixed in version 3.0.5.13.0, which means it should be available in 6i (the version you are using) also. But from the bug description I see that it is reproduced with Reports 6.0.5.28.0 version also. If your reports 6i version is higher than this, it may contain this fix. Best thing is to apply the latest patch. The patches should be available in metalink (metalink.oracle.com) .
    2) For troubleshooting purposes run the report in html/rtf and see whether it times out. ( just to see whether
    this is a PDF specific issue)
    3) Disable acrobat web integration (in Adobe acrobat settings) and try . This will prevent Acrobat reader from opening the pdf automatically and instead will show a dialog to save the pdf report ( There are some IE - Adobe issues which are not reports bugs).
    4) There were some threads some time back which had this problem with long running reports and PDF. Finally it turned out to be webserver timeout problems. Pls see ( this is for 9i servlet and Apache webserver, but for 6i also it could be similar)
    Re: Long running reports end successfully - present s "page can not be foun
    5) If these does not work and if you are not able to make further progress, I suggest you to get in touch with Oracle Support (if you have a support contract) to solve this issue. [ If the possibility is that the bug you are mentioning is not pushed forward to 6i (a remote chance) then only they will be able to a get a oneoff patch.]
    Thanks
    Ratheesh

  • LR 5.5 upgrade. I only get the the 32 bit set up and an error when the 64 bit set up should be created. It says not enough disk space and no access to write. The disk space is ok and the 32 bit file was indeed created.

    LR 5.5 upgrade. I only get the the 32 bit set up and an error when the 64 bit set up should be created. It says not enough disk space and no access to write. The disk space is okay and the 32 bit file was indeed created. I have Windows 7 Home edition.

    Hi Rob, Thanks for your input. The temp location is on the C drive with 228 GB free space. My other drives have 123 GB and 204 GB of free space. I can see how the 32 bit set up is perfectly extracted when it stops when coming to the 64 bit set up. I have done the exercise several times and also made new downloads. I am using Norton 360 and Malwarebytes anti-malware but the dowload from Adobe should be trusted.

  • No data media can be created for the proposal run - Bacs Payment

    Hi,
    When i schedule program RFFOGB_T for bacs payment and select proposal run only i get the following error "No data media can be created for the proposal run". But when i execute the program with out selecting the check box " Proposal run only...a file was getting generated...Could any onle pls help me resolve this problem.
    With Best Regards,
    M.Naveen Kumar

    The post has been answered

Maybe you are looking for

  • Sales Document number in FBL5N

    Hi Friends, In FBL5N (customer line item report) there is a field "Sales Document" Field Name "VBEL2". But the accounting document which is generated in FBL5N for billing document from SD in not populating the sales order number in this field, this f

  • The sound stopped working on Mac Book Pro OS X?

    The sound stopped working. Firefox installed updates and since, the sound is disactivated. I went to preference, and the silence box is checked, but it doesn't allow me to uncheck it. The sound peripheric is not recognised it seems. What can I do?

  • GPO for SUP SCCM 2012 R2 Cu3

    Hello, which Settings in a GPU do i have to configure for using SUP We are using a WSUS at the moment.

  • Text ONLY editor???

    How does one create a TEXT ONLY file in standard install Tiger?? The reason I ask is becasue I've just installed PHP on a computer at work, with the intention of running phpBB on it. Just so I know the php is installed OK, I just wanted to create a p

  • Recording a Choir I need help !!

    I use Logic 8 with a G4. I have laid the tracks that will have choir parts added to them. I intend to lay these choir parts at various churches and may also do some recoding at a studio with large enough rooms. I will take these projects to these var