Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » System.IO   (RSS)

System.IO.Compression Capabilities [Kim Hamilton]

We often get asked about the capabilities of the .NET compression classes in System.IO.Compression. I'd like to clarify what they currently support and mention some partial workarounds for formats that aren't supported. The .NET compression libraries
Posted by BCLTeam | 16 Comments
Filed under: , ,

Long Paths in .NET, Part 2 of 3: Long Path Workarounds [Kim Hamilton]

For now, our suggested workaround for users that encounter the MAX_PATH issue is to rearrange directories so that the names are shorter. This may sound like a cop out, but this is ultimately easier on users because of (1) limited tool support (i.e. Explorer
Posted by BCLTeam | 12 Comments
Filed under: ,

Long Paths in .NET, Part 1 of 3 [Kim Hamilton]

Let’s start by looking at one of the more interesting exception messages in the BCL, the PathTooLongException: [PathTooLongException]: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters,
Posted by BCLTeam | 22 Comments
Filed under: ,

Introducing Pipes [Justin Van Patten]

The Orcas October Community Technology Preview (CTP) includes new types that make it easy for developers to use pipes from managed code. Pipes are used for inter-process communication (IPC) between processes running on the same machine, or processes running
Posted by BCLTeam | 14 Comments

Top 5 SerialPort Tips [Kim Hamilton]

The SerialPort class requires some “warming up” time for our users coming from VB6 or other non-.NET backgrounds. One of the main reasons is that SerialPort and its underlying BaseStream are designed to behave similarly to other .NET streams, which (for
Posted by BCLTeam | 2 Comments
Filed under:

FileInfo.LastWriteTime discrepancies [Lakshan Fernando]

I recently investigated a customer issue of incorrect time reporting with FileInfo.LastWriteTime and thought of sharing this information in the blog. In the customer case, the last write time was off by about one hour for some files. We depend on two
Posted by BCLTeam | 6 Comments
Filed under:

SerialPort Encoding [Ryan Byington]

The SerialPort class uses the encoding specified by the SerialPort.Encoding property to convert strings and character arrays to bytes to send across the serial port. This encoding also gets used when reading from the serial port to convert bytes received
Posted by BCLTeam | 5 Comments
Filed under:

SerialPort and DataReceived Event [Ryan Byington]

I have seen a few customers complain that their DataReceived event handler was never getting called and I thought I would share their problems here so you can learn from their mistakes. The problems revolve around the port not being open. This is sometimes
Posted by BCLTeam | 2 Comments
Filed under:

Using a MemoryStream with GZipStream [Lakshan Fernando]

We’ve seen cases where our customers have run into issues when using a MemoryStream with GZip compression. The problem can be frustrating to debug and I thought I’ll blog about it in the hope that others would avoid a similar issue. The code for this
Posted by BCLTeam | 8 Comments
Filed under:

Using FileStream from Restricted User Accounts [Josh Free]

Every so often, I run into code that requests security permissions that are not needed. Take the following code snippet as an example: // open the file for reading FileStream fs1 = new FileStream ( @"C:\Program Files\SomeFile.bin" , FileMode .Open); From
Posted by BCLTeam | 4 Comments
Filed under:

Reading a file in Managed Code [Lakshan Fernando]

Some of our new users to managed code take a little time to get used to the design pattern in reading a file. I thought I’ll enumerate through the most common patterns for their benefit; Reading from a FileStream : Create a suitable buffer size – the
Posted by BCLTeam | 2 Comments
Filed under:

Using GZipStream for Compression in .NET [Brian Grunkemeyer]

One of the cool new features in Whidbey is a GZipStream class, which supports GNU's zip utility (gzip). For anyone with a Unix background, you've had to come across .tar.gz or .tgz files as you deal with the tedium that accompany downloading new source
Posted by BCLTeam | 6 Comments
Filed under: ,

How to set MACL from one directory to another? [Ravi Krishnaswamy]

A correct way to do this will be as follows: // Get DirectorySecurity from source directory DirectorySecurity dsSrc = Directory.GetAccessControl(srcPath, AccessControlSections.Access); // Transfer ACL security descriptor byte[] sdBinary = dsSrc.GetSecurityDescriptorBinaryForm();
Posted by BCLTeam | 2 Comments
Filed under:

DirectoryInfo.Name lacks security checks [Ravi Krishnaswamy]

This came out of one of our internal security review. I thought I would post it here for beware sake. DirectoryInfo’s Name property currently requires no permission checks in and of itself, though you do need Read permission to construct a DirectoryInfo
Posted by BCLTeam | 2 Comments
Filed under:

IO Exceptions will now reveal FullPath (if you have PathDiscovery access) [Ravi Krishnaswamy]

You might start noticing that in Whidbey Beta2, IO exceptions are handing out full qualified path which was previously regarded as secure information. Well, don’t be alarmed . This information is still secure and let me explain how. IO classes often take
Posted by BCLTeam | 2 Comments
Filed under:
More Posts Next page »
 
Page view tracker