Can't get file time

Hi,
I need to get the file times for a file existing in the same directory as the exe file itself. However, the getfiletime function I'm using returns 0, which means it doesn't work. The error code is 87,
ERROR_INVALID_PARAMETER. Could anyone see what could be wrong with the following? I work with C Winapi in Microsoft Visual C++ 2010 Express.
FILETIME ftCreate, ftAccess, ftWrite;
HANDLE hFile;
LPCWSTR fname = L"gnsh.dat";
BOOL WINAPI timeresult;
hFile = CreateFile(fname, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
timeresult = GetFileTime(hFile, &ftCreate, &ftAccess, &ftWrite);
Thanks in advance.

I am confused -- you say that hFile is not INVALID_HANDLE_VALUE, but you say that hFile is 0xFFFFFFFF.  One of those statements must be false, since INVALID_HANDLE_VALUE == 0xFFFFFFFF.
Now since ftCreate is a FILETIME which is a structure, I don't know what you intend to determine by sending it to swprintf with the %d format flag. 
If you want to look at ftCreate as an integer, you could use something like
ULARGE_INTEGER li = { ftCreate.dwLowDateTime, ftCreate.dwHighDateTime };
swprintf(testtxt, 25, L"%I64d", li.QuadPart);
Now, this will still give you some sort of crazy number that is more or less meaningless to a human, but at least it is the correct crazy number.  (It is the number of 100 ns intervals since 1601 if you care).
If you want a human readable string there are a few approaches.  You could convert the file time to a
system time . You can then use printf yourself on the system time or
GetTimeFormatEx to get a string.  You could also convert the
FILETIME to a time_t and use strftime or similar functions to get a human readable string.

Similar Messages

  • Can i get the time capsule to automatically back up my file from my Mac Book Air but have certain files which are only stored on the time capsule and not the computer? Then can i access these files only on the time capsule without connecting it?

    Can i get the time capsule to automatically back up my file from my Mac Book Air but have certain files which are only stored on the time capsule and not the computer? Then can i access these files only on the time capsule without connecting it?

    igonneau wrote:
    Can i get the time capsule to automatically back up my file from my Mac Book Air but have certain files which are only stored on the time capsule and not the computer?
    You can, but how are you going to back up those other files?  When (not if) your Time Capsule fails, you risk losing them.  See #Q3 in Using Time Machine with a Time Capsule for details.
    Then can i access these files only on the time capsule without connecting it?
    Not sure what you mean.  You have to connect a computer, either via Ethernet cable or wirelessly, to read or write to the disk. 

  • How can I get my time machine to allow me to recover files again? After upgrading to OS X, the time machine still backs up the files; but, I'm not able to navigate within the time machine or select any folders or files for restore.

    How can I get my time machine to allow me to recover files again?
    After upgrading MBA to OS X, the time machine still backs up the files; but, I'm not able to navigate within the time machine or select any folders or files for restore.
    I've searched and can not find a solution to the problem that's being encountered.

    Yeap that all makes sense now.
    Do you only have the current backup showing in the TM display?? Won't it fill in the rest?
    Over wireless are you waiting for the indexing to finish.. ??
    Previous backup may not show for a couple of hours.
    Long short of it.. Mavericks version of TM is a pain.
    Sometimes it is easier to completely ignore the TM backup and do the restore manually.
    I have posted the details here. See if this helps.
    Can't access old files on time capsule

  • How can I get files to open automatically upon download?

    I would like files I download to open automatically and for the download window to be turned off. I know how to turn off the download window, but cannot get files to automatically download.

    Hi JJMack. Thanks for getting back to me.
    I think I've created confusion about what I want. All I want is to end up with a file that is flattened so that I can save it as a tiff without getting a warning that it contains layers. Please correct me if I’m wrong but I’ve always assumed I should always flatten a file before I save it as a tiff unless I specifically want to retain layers or transparency. I’m only talking here of files that open with a single layer: ie. Layer 1. I assume that if I don’t flatten such files the resultant files will be unnecessarily big?
    The only reason I keep saying I want a Background layer is that I know that a flattened file will only have a Background layer. I don’t have any desire for a Background layer per se. I certainly don’t want to add extra layers - quite the opposite.
    So perhaps the question I should have asked should have been:
    How can I get files to open 'ready-flattened' by default so I can save them directly to tiff without having to manually flatten them every time?
    Cheers

  • How can I get file list for a given directory?

    Hi,
    How can I get file list for a given directory? Is there a function?
    Thanks.

    Hi friend,
    Try this sample report. It displays all files in a directory.
    While executing give some directory name in input. ex:  C:\
    Mention file type in filter parameter. ex: *.DOC
    REPORT ztests.
    DATA : file_table LIKE TABLE OF sdokpath WITH HEADER LINE .
    DATA : dir_table LIKE TABLE OF sdokpath WITH HEADER LINE .
    PARAMETERS:p_dir(50) TYPE c.
    CALL FUNCTION 'TMP_GUI_DIRECTORY_LIST_FILES'
      EXPORTING
        directory  = p_dir
        filter     = '*.DOC'
      TABLES
        file_table = file_table
        dir_table  = dir_table
      EXCEPTIONS
        cntl_error = 1
        OTHERS     = 2.
    LOOP AT file_table .
      WRITE:/ file_table-pathname.
    ENDLOOP.
    Might be helpful...
    Thanks.....
    Edited by: Guest77 on Feb 11, 2009 5:30 AM

  • Can't get face time to work

    Since upgrading to ios7, I can't get face time or message to work. When I try to sign in with Apple ID, I get error message saying check wifi connection and try again. I looked at support pages but can't sign in. Face time works ok on iPod touch

    Try Reset all settings
    Settings>General>Reset>Reset All Settings
    Note: Data will not be affected but settings will be reset.

  • How can I get a time stamp on text message without turning on "read"???

    How can I get a time stamp on text message iPhone 5 IOS 7? (Without having to send read receipt)

    You can make the "Visit Date" column visible in the Bookmarks Manager (Library) via "Views > Show Columns"
    * Bookmarks > Organize Bookmarks
    *http://kb.mozillazine.org/Viewing_the_browsing_history_-_Firefox

  • How can i get current time of a given timezone

    how can i get current time of a given timezone
    for example: Asia/Hong_Kong
    my code is like this, but the result is not correct.
    what's wrong?
    import java.util.*;
    public class test {
    public static void main(String[] args){
              String s = "Asia/Hong_Kong";
              String tempS = "";
              TimeZone myTime = new SimpleTimeZone(s);
              //TimeZone myTime = TimeZone.getTimeZone(s);
              Calendar myCal = new GregorianCalendar(myTime);
              tempS = myCal.get(Calendar.YEAR)+"-"+
                        (myCal.get(Calendar.MONTH)+"-"+
                        myCal.get(Calendar.DATE)+" "+
                        (myCal.get(Calendar.HOUR)+":"+
                        myCal.get(Calendar.MINUTE)+":"+
                        myCal.get(Calendar.SECOND);
              System.out.println(tempS);
    output is : 2001-7-15 11:16:48
    but the correct time should be: 2001-8-16 7:17:48
    the correct time should be 2001-8-16

    Certain indexes in the Calendar API start at 0 rather then 1, so, when you get the value, you may want to increment.
    I'm not sure why the time is incorrect. You may want to call getAvailableIDs() and make sure that the desired TimeZone ID is supported by your version. I doubt that Sun would have incorrect support for the time zone, but it may not be included, or perhaps it is included with a diffrent ID. You can always create your own time zone as well, by passing the String offset to getTimeZone(), the offset being how many hours beyond or before GMT. Hopefully this helps.

  • I can't get files to attach in e-mail quickly.

    I can't get files to attach in e-mail. I get a prompt to retry or switch and retry. Switching works but the process takes too long.

    Which email client are you using? 

  • Can I get Quick time video on iPad 2? Specifically, when I receive an email with quicktime on it, it will not play on the iPad.

    Can I get Quick time video on iPad 2? Specifically, when I receive an email with quicktime on it, it will not play on the iPad.

    Hello.  I have AV player hd.  When I touch and hold the Quicktime icon that is in a received mail message, a prompt comes up "Open in AVPlayerHD".  I click on that and a black screen opens up with the following on it:
    1--A red line at the top with a short white slider button on the right hand side.  There is a time listed at each end of the red line that says 00:00
    2--On the left hand side of the screen, near the middle, there are 4 icons, a colored 'x', a dialogue icon, a circular arrow and an 'i' in a circle.
    3--On the right hand side there is a + and a - sign with '1.00x' in the middle of the two.
    4--At the bottom of the black screen is a play icon plus forward and fast forward icons.
    When I press the play icon it changes to a stop icon.
    So, even though I have AV player I cannot play this Quicktime slideshow.
    Any help would be appreciated.  Thanks.

  • How can i get the time to appear on my stored data in notepad

    Hi all,
    I was wondering how can i get the time to appear on my stored data in notepad? I saw an example before but i forgotten which example was it.. Any ideas??
    holla
    Attachments:
    TextFile1.txt ‏3 KB

    Hi
    Im using Labview 8.2. Currently it just shows the data without the time. Im not sure what to do. It works perfectly though. I just want the time to appear on my notepad along with my data
    holla
    Attachments:
    Testing1.txt ‏1 KB
    Untitled 231_LV80.vi ‏23 KB

  • How can i get the time and result together show in one Array or in Cluster?

    hello everyone i am a new user .I want to get the time and voltge form a Generater. How can i get the time and result together show in one Array or in Cluster?When i selecte the first(or third...) result then in the front panel display the time and the voltge.Thank you!
    I post the time and voltge NOT together photo
    Attachments:
    12345.GIF ‏54 KB

    You can create an array of clusters with one element being the time and the other being the voltage, like so (using the "Get Waveform Components" function):
    Message Edited by smercurio_fc on 10-17-2007 03:15 PM
    Attachments:
    pic.PNG ‏11 KB

  • How can I get the time in Microsecond with JNI ?

    How can I get the time in Microsecond with JNI ?

    JNIEXPORT jdouble JNICALL Java_Win32Native_queryPerformanceFrequency (JNIEnv *env, jobject obj) {
         LARGE_INTEGER lFrequency;
         ::QueryPerformanceFrequency(&lFrequency);
         return (jdouble)lFrequency.QuadPart;
    JNIEXPORT jdouble JNICALL Java_Win32Native_queryPerformanceCounter (JNIEnv *env, jobject obj) {
         LARGE_INTEGER lpCounter;
         ::QueryPerformanceCounter(&lpCounter);
         return (jdouble)lpCounter.QuadPart;

  • How can I get my Time Capsule to show up in finder?

    How can I get my Time Capsule to show up in finder?

    An alternate, and simpler method for most users is to open any Finder window, then look for the Time Capsule icon under the Shared heading on the left side of the window.
    When you click on the Time Capsule icon, a folder......named "Data", unless you have changed the name of the drive.....will appear to the right.
    Double-click "Data" to mount the Time Capsule drive on the desktop, where you can now drag/drop or copy/paste data to the drive.
    If the Time Capsule does not appear under the Shared heading when you open a Finder window......then you are likely using the Yosemite operating system on your Mac, and it will take some work to find it.
    In that case, Niel's method might be the better way to go.

  • I have a G4 Quicksilver that no longer works, but the hd may still be good. How can I get files off the G4 hd and onto my new iMac?

    I have a G4 Quicksilver 2001 that no longer works, but the hd may still be good. How can I get files off the G4 hd and onto my new late 2013 iMac?

    Also, how do I boot the G4 into FireWire Target Disk mode?
    First, the G4 must be able to start to use FWTDM. If it can start, hold the t key at boot until you get a "screensaver pattern" that looks like this:
    If the G4 is attached via a FireWire cable to a newer Mac with a FireWire port, the G4's hard drive will appear on the other Mac's desktop just as if it were any external drive. A USB cable won't work for FWTDM.
    Just wondering if the drive in my G4, which I believe may be an ATA drive will also work in an enclosure for a SATA drive?
    No. ATA (actually "PATA" or "IDE") and SATA are different interfaces. PATA external enclosures are now very hard to find. You best and least expensive option is the adaptor that BDAqua linked. One of its connectors is for PATA drives.

Maybe you are looking for

  • DWLoader works in SSIS Execution Process Task?

    Does anyone knows if PDW's DWLoader works in SSIS Execution Process Task? Is there a sample? I struggle to find documentation on using DWLoader.exe in Execution Process Task (EPT) of SSIS. There are articles in PDW BOL about DWLoader.exe or SSIS to l

  • Error using p_publish_date in add_item function

    Hi, I use the add_item function to add an item to a page. When I use the publish date parameter (p_publish_date) I get the error: ORA-06502: PL/SQL: numeric or value error: character to number conversion error ORA-06512: at "PORTAL.WWSBR_API", line 8

  • Dynamic where clause for generated reports (designer 6.0)

    Hi, I'd like to include dynamic where clause into my reports. It's easy with report builder by using bind parameter in a query where clause (&param where param is a parameter in which you fill a VARACHAR2 to complete default where clause). Problem wi

  • "SYSTEM ERROR" ABOUT WIFI CONNECTION

    Hello, Everytime I try to search for a wifi service, I get the following error: "System error" The only option I have is to press "OK" and it defaults back to the menu. My mobile est NOKIA E75 I can't connect my phone to internet when i try etablish

  • Ipod wont mount/format does nothing/ hd dead?

    HI I own a 3g ipod 15gb. It had been working fine. A week ago, I put it to sleep, and when it woke up it kerp flashing the broken folder icon and then reseting. I cound not mount it. By pressing the foreward button, I would get into disk mode. Connec