DOSFS and the short and Long file names.

Chris Johns chrisj at rtems.org
Thu Aug 4 04:34:59 UTC 2011


On 4/08/11 1:59 PM, Nasir, Aliasgar ( SBU-ETS ) wrote:
> Hi,
>
> With the RTEMS4.10, we noticed that there is concept about long and
> short file names in the DOSFS.
>
> We use the DOSFS on an SDCARD. When we try to write a file on the card,
> with file name say ‘Error2.txt’, the DOSFS detects this as a long file
> name and then executes the below code in function
> msdos_find_name_in_fat_file(), while creating the file.
>
> *if**(*name_type*==*MSDOS_NAME_LONG*)*
> *{*
> *int*slot*=**(((*empty_space_offset***bts2rd*)**+*empty_space_entry*)**/*
> MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE*)**+*lfn_entries*+*1*;*
> msdos_short_name_hex*(*MSDOS_DIR_NAME*(*name_dir_entry*),*slot*);*
> *}*
>
> The above piece of code modifies the file name as ERR~0005.TXT. This is
> the file name seen when we see the contents of the card on a Windows
> based machine using card reader. The file name of the file as seen from
> the RTEMS shell is still ‘Error2.txt’
>
> Can anyone guide as what should be done to see a the correct file name
> (Error2.txt) on the Windows machine?
>

You have used mixed case and this cannot be handled with a short file 
name therefore it has used a long file name which does maintain the 
case. Windows should notice this and show the short and long filenames.

> Regards,
>
> Ali
>
>
> ------------------------------------------------------------------------
> Information contained and transmitted by this e-mail is confidential and
> proprietary to iGATE Patni and its affiliates and is intended for use
> only by the recipient. If you are not the intended recipient, you are
> hereby notified that any dissemination, distribution, copying or use of
> this e-mail is strictly prohibited and you are requested to delete this
> e-mail immediately and notify the originator or
> mailadmin at igatepatni.com. iGATE Patni does not enter into any agreement
> with any party by e-mail. Any views expressed by an individual do not
> necessarily reflect the view of iGATE Patni. iGATE Patni is not
> responsible for the consequences of any actions taken on the basis of
> information provided, through this email. The contents of an attachment
> to this e-mail may contain software viruses, which could damage your own
> computer system. While iGATE Patni has taken every reasonable precaution
> to minimise this risk, we cannot accept liability for any damage which
> you sustain as a result of software viruses. You should carry out your
> own virus checks before opening an attachment. To know more about iGATE
> Patni please visit www.igatepatni.com.
>

You have posted to a public mailing list. Please check the polices 
statement [1] before posting again.

Chris



More information about the users mailing list