getting file attributes

  • Hi Friends,

    In SSIS, I am trying to get file attributes through script task. I am using FILEINFO method to collect those information. I could get all the details but 'created by' . I could not find the option who actually created the file.

    How to get that? Please help me friends.

    Any suggestions would be really appreciated.

    Thanks,
    Charmer

  • Charmer (8/11/2015)


    Hi Friends,

    In SSIS, I am trying to get file attributes through script task. I am using FILEINFO method to collect those information. I could get all the details but 'created by' . I could not find the option who actually created the file.

    How to get that? Please help me friends.

    Any suggestions would be really appreciated.

    If I right-click on a file in Windows Explorer (W7), none of the properties displayed is 'CreatedBy'. The closest thing to it is 'Owner', but it's clearly not the same thing.


  • I am collecting the attributes of a dtsx file. Is there a way to collect the owner of the package or 'who created it' information?

    Thanks,
    Charmer

  • Sure, just read the XML inside the file and find the value of the DTS:CreatorName property.


  • Thank you Phil, you gave me an idea

    but Just curious...Is there a way to get it on the GO?

    Like we get the below informations....Just curious...through vb/c# coding?

    FileInfo fileinfo;

    fileinfo = new FileInfo(Dts.Variables["User::VarFileName"].Value.ToString());

    Dts.Variables["User::VarFileCreationDate"].Value = fileinfo.CreationTime;

    Dts.Variables["User::VarFileLastModifiedDate"].Value = fileinfo.LastWriteTime;

    Dts.Variables["User::VarFileLastAccessDate"].Value = fileinfo.LastAccessTime;

    Dts.Variables["User::VarFileSize"].Value = fileinfo.Length;

    Thanks,
    Charmer

  • Charmer (8/11/2015)


    Thank you Phil, you gave me an idea

    but Just curious...Is there a way to get it on the GO?

    Like we get the below informations....Just curious...through vb/c# coding?

    FileInfo fileinfo;

    fileinfo = new FileInfo(Dts.Variables["User::VarFileName"].Value.ToString());

    Dts.Variables["User::VarFileCreationDate"].Value = fileinfo.CreationTime;

    Dts.Variables["User::VarFileLastModifiedDate"].Value = fileinfo.LastWriteTime;

    Dts.Variables["User::VarFileLastAccessDate"].Value = fileinfo.LastAccessTime;

    Dts.Variables["User::VarFileSize"].Value = fileinfo.Length;

    Don't think so. The documentation here backs that up.


  • Thank you Phil...It seems I need to get that in XML format and get the info as like as you said

    Thanks,
    Charmer

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply