Solved

detect the size of a file when it is copied to a external device

Posted on 2014-11-27
8
243 Views
Last Modified: 2014-12-03
I would like to know if you have an example of perhaps an advice about how to detect the size of a file when it is copied to an external device like a usb or external hard disk.

Best regards
0
Comment
Question by:altariamx2003
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 40470024
As it is the same size as that on your local hard disc (because copy isn't changing the file contents) maybe you ought to rethink your question.  You want something but it isn't clear what you want to know.
0
 
LVL 9

Expert Comment

by:teebon
ID: 40470039
You can determine the file size by using fileinfo. code example
0
 
LVL 9

Assisted Solution

by:teebon
teebon earned 150 total points
ID: 40470042
You can also improvise on this
File Activity Tracker
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 21

Expert Comment

by:Tapan Pattanaik
ID: 40470157
Hi altariamx2003,

Public Class  FileSize
    Public Shared Sub Main
   
        Dim fileDetails As IO.FileInfo


        fileDetails = My.Computer.FileSystem.GetFileInfo("test.txt")

        Console.WriteLine("Size: " & fileDetails.Length & " byte(s)")
    End Sub

End Class
0
 

Author Comment

by:altariamx2003
ID: 40470515
You are right AndyAinscow let me try to explain a little better

In this new project I need to do a program that track or monitor if the user plug an external device (usb, external disk drive, etc....) to a computer and try to copy any file  to the external device plugged, the program need to send an internal alert(a email to somebody) about this issue.

I hope this help

I really dont have a clue hehehehe, and i dont know how to start

Any advice will appreciated

Thanks
0
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 350 total points
ID: 40470519
I think the following is what you want:
http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher%28v=vs.110%29.aspx
A FileSystemWatcher.  There are links to examples of the various functions provided by that class.
0
 
LVL 6

Expert Comment

by:Rob G
ID: 40470529
You can use this too:
http://www.solarwinds.com/log-event-manager.aspx

We use it here,
It works in Windows, Mac, and Linux..
0
 

Author Comment

by:altariamx2003
ID: 40479892
Sorry for the delay
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A short article about a problem I had getting the GPS LocationListener working.
A short article about problems I had with the new location API and permissions in Marshmallow
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question