CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 12 of 12
  1. #1
    Join Date
    Mar 2008
    Posts
    18

    Question How to Get Copy/Paste File Information

    Hi,
    I want to need of copy file/Folder information(File Name,File Path,File Data ...) which is currently copy.

    secondly I want to need same for Paste file/Folder information.


    Thanks

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: How to Get Copy/Paste File Information

    Could you describe more clear what and how you are doing (trying to do)?What is the problem you are trying to accomplish?
    Victor Nijegorodov

  3. #3
    Join Date
    Mar 2008
    Posts
    18

    Question Re: How to Get Copy/Paste File Information

    Quote Originally Posted by VictorN
    Could you describe more clear what and how you are doing (trying to do)?What is the problem you are trying to accomplish?
    I m developing a Utility getting for Copy/Paste information.
    i want to find some details like

    1. List of Copy/Paste file Name,Drive.
    2. Path of Copy/Paste File Name
    3. Time of Copy/Paste
    4. Size of Files/Folder

    Thanks

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: How to Get Copy/Paste File Information

    It is still not clear what you want/mean: is it just a "copy file" operation (using CopyFile(Ex) or ShFileOperation API) or do you want to develop some tool to work with the Clipboard?

    Anyway:
    1-2. Providing you have the full path name of the file you can split it to get file name, folder and drive using either CRT-function _splitpath/_wsplitpath or Path... APIs such as PathFindExtension, PathFindFileName, PathGetDriveNumber, PathFindNextComponent, ...
    3. If you mean the time when you copy the file - then GetSystemTime API (or COleDateTime::GetCurrentTime)
    4. There is no such a function returning size of the Folder. You should enumerate all the files within the folder (MFC class CFileFind) and calculate the sum of sizes of all the files (CFileFind::GetLength)
    Victor Nijegorodov

  5. #5
    Join Date
    Mar 2008
    Posts
    18

    Re: How to Get Copy/Paste File Information

    Quote Originally Posted by VictorN
    It is still not clear what you want/mean: is it just a "copy file" operation (using CopyFile(Ex) or ShFileOperation API) or do you want to develop some tool to work with the Clipboard?

    Anyway:
    1-2. Providing you have the full path name of the file you can split it to get file name, folder and drive using either CRT-function _splitpath/_wsplitpath or Path... APIs such as PathFindExtension, PathFindFileName, PathGetDriveNumber, PathFindNextComponent, ...
    3. If you mean the time when you copy the file - then GetSystemTime API (or COleDateTime::GetCurrentTime)
    4. There is no such a function returning size of the Folder. You should enumerate all the files within the folder (MFC class CFileFind) and calculate the sum of sizes of all the files (CFileFind::GetLength)
    Ok it's good but how can i know from which drive file is copy.And i am not going to use clipboard.

    Simply i want to know from which drive file is copy/past.

  6. #6
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: How to Get Copy/Paste File Information

    But isn't it *YOU* who copies/pastes this file?
    Victor Nijegorodov

  7. #7
    Join Date
    Mar 2008
    Posts
    18

    Re: How to Get Copy/Paste File Information

    Quote Originally Posted by VictorN
    But isn't it *YOU* who copies/pastes this file?
    See any one use this Utility.So User don't know about that.

  8. #8
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: How to Get Copy/Paste File Information

    Quote Originally Posted by anubhava
    See any one use this Utility.So User don't know about that.
    What do you mean?

    Quote Originally Posted by anubhava
    Simply i want to know from which drive file is copy/past.

    What information about the file to copy do you have? File path name? Then use one of the functions I referred to to obtain the drive.

    Or you meant something comletely different? Then please describe more clear what and how you are doing
    Victor Nijegorodov

  9. #9
    Join Date
    Mar 2008
    Posts
    18

    Question Re: How to Get Copy/Paste File Information

    Quote Originally Posted by VictorN
    What do you mean?


    What information about the file to copy do you have? File path name? Then use one of the functions I referred to to obtain the drive.

    Or you meant something comletely different? Then please describe more clear what and how you are doing
    My software is running in hidden mode. My utility is like a logger. Which store the information of all copy/paste.For that i want to need of Copy/Paste information (Files/Folders name,Drive Name,Time etc.).



    Thanks

  10. #10
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: How to Get Copy/Paste File Information

    Where does your "logger" get the initial information about "Copy/Paste" from? How?
    What type of such an information about "Copy/Paste" does it get?
    Victor Nijegorodov

  11. #11
    Join Date
    Mar 2008
    Posts
    18

    Question Re: How to Get Copy/Paste File Information

    Quote Originally Posted by VictorN
    Where does your "logger" get the initial information about "Copy/Paste" from? How?
    What type of such an information about "Copy/Paste" does it get?

    My utility is like a service. which store all Files/Folder related information in Log.

    Like as : Which file/Folder is renamed,Modified,Move,Create,delete.

    For that how to get file information which is copied/Pasted.


    Thanks

  12. #12
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: How to Get Copy/Paste File Information

    Quote Originally Posted by anubhava
    My utility is like a service. which store all Files/Folder related information in Log.

    Like as : Which file/Folder is renamed,Modified,Move,Create,delete.

    For that how to get file information which is copied/Pasted.
    Does your " like a service" already exist/work and is able to get at least something about the file operations?
    Or it is only aour dream to somehow develop such an application?
    If former - then what information are you already able to get?
    If latter - have a look at FindFirstChangeNotification/FindNextChangeNotification and/or ReadDirectoryChangesW APIs
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured