Monday, February 27, 2012

Windows: mysterious folders

A few days ago i faced a simple task related with xml parsing. Generally speaking, it was about parsing a bunch of files (around 20 thousand) containing information about domains. This information should be stored into MSSQL database. The situation was the following: those xml files were created under linux os. Each file name matched the following pattern: [domainname].[domainzone].xml and they were sent to me in a .zip archive. So i wrote a simple script, iterating through all .xml files in folder, fetching the data within linq to xml and inserting in in a proper tables. I left this script working and gone to have a coffee.

When i came back i realized, that one single file was missing. The domain name was "aux", and after unzipping the file name appeared to be [_aux_].[_domainzone_].xml_ Something like this - containing underscores. No problem, i decided to rename it and run the script again, but the cursed file refused to be renamed.

I googled this problem and found the answer. The problem is that Windows has some restricted file names, such as for example aux, com, con, prn, nul and others. So it is not possible to create files or folders with such names. I decided to check one more guess: i navigated to this web site and tried to save the web page using my browser. No surprise that I saw a warning.

No comments :

Post a Comment