dbTalk Databases Forums  

Copy Files with long file names

comp.databases.ms-access comp.databases.ms-access


Discuss Copy Files with long file names in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #21  
Old   
David-W-Fenton
 
Posts: n/a

Default Re: Copy Files with long file names - 10-28-2010 , 04:02 PM






Salad <salad (AT) oilandvinegar (DOT) com> wrote in
news:NZSdnS9boImXAlXRnZ2dnUVZ_uOdnZ2d (AT) earthlink (DOT) com:

Quote:
bala said "According to them they want to identify the nature of
the file by glancing at the name." A filename of 260+chars is not
glancing, that's reading a sentence per filename. If one wants to
glance, your suggestion of redesigning the naming convention makes
sense. Or store the long stuff to a memo field in a table and copy
to a short name.
I miss being able to vote up an answer when not reading
StackOverflow.com. This would definitely get a +1 vote from me.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Reply With Quote
  #22  
Old   
Salad
 
Posts: n/a

Default Re: Copy Files with long file names - 10-28-2010 , 04:04 PM






David-W-Fenton wrote:

Quote:
Salad <salad (AT) oilandvinegar (DOT) com> wrote in
news:Hqqdnbxa6fd3I1XRnZ2dnUVZ_qudnZ2d (AT) earthlink (DOT) com:


I sometimes wish there were a property, maybe called Purpose,
where a filename, when saved, could have a memo attached to it.
When one does a dir or via Explorer one sees that property field
in the list as well. MS could have done that years ago.


With Office files, that already exists.

Yes. Looking at google it appears one needs to dl a file called DSOFile
then registering the ActiveX but I saw mention of Office in some
threads. Not having needed such a capability it is nice to know it exists.

Reply With Quote
  #23  
Old   
Tony Toews
 
Posts: n/a

Default Re: Copy Files with long file names - 10-28-2010 , 07:32 PM



On Wed, 27 Oct 2010 13:25:45 -0700, Salad <salad (AT) oilandvinegar (DOT) com>
wrote:

Quote:
What is so long; the filename or the folder name? If folder name, you
can map a drive letter
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.MapNetworkDrive "L:", "\\mydrive\share"

Then you'd copy the file to drive L:
I doubt very much that you can get around this problem by assiing a
drive letter to a share. I stronglyI suspect in Windows of any sort
the length of the server name, share name, folders and file name is a
maximum of 260.

The drive letter plus the file name is a lot shorter on your system
but the file server won't allow you to use that file name.

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeupdater.com/

Reply With Quote
  #24  
Old   
bala
 
Posts: n/a

Default Re: Copy Files with long file names - 10-29-2010 , 06:52 AM



On Oct 28, 8:32*pm, Tony Toews <tto... (AT) telusplanet (DOT) net> wrote:
Quote:
On Wed, 27 Oct 2010 13:25:45 -0700, Salad <sa... (AT) oilandvinegar (DOT) com
wrote:

What is so long; the filename or the folder name? *If folder name, you
can map a drive letter
* Set WshNetwork = CreateObject("WScript.Network")
* WshNetwork.MapNetworkDrive "L:", "\\mydrive\share"

Then you'd copy the file to drive L:

I doubt very much that you can get around this problem by assiing a
drive letter to a share. *I stronglyI suspect in Windows of any sort
the length of the server name, share name, folders and file name is a
maximum of 260. * *

The drive letter plus the file name is a lot shorter on your system
but the file server won't allow you to use that file name.

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages -http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog -http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
* updated seehttp://www.autofeupdater.com/
I will definitely take a look at the custom file property.

Stuart I definitely will look into it.

Also I did a simple test. I manually renamed an existing Excel file
(contain Data) with a long name (253 char lenght). The long name was
accepted but when I tried to open Excel file it gave me a error that
the file name is too long. When I reverted back to the original short
name or any short name it opened fine and displayed the Data.

Since Windows XP (and I believe Windows 7 too) handles max lenght of
260 I believe even if we successfully rename and copy any files with
long name the behaviour of the copied file can be unpredictable.

Thanks again.

Reply With Quote
  #25  
Old   
David-W-Fenton
 
Posts: n/a

Default Re: Copy Files with long file names - 10-29-2010 , 05:05 PM



Salad <salad (AT) oilandvinegar (DOT) com> wrote in
news:V4ydnWV_WdD6eFTRnZ2dnUVZ_q6dnZ2d (AT) earthlink (DOT) com:

Quote:
David-W-Fenton wrote:

Salad <salad (AT) oilandvinegar (DOT) com> wrote in
news:Hqqdnbxa6fd3I1XRnZ2dnUVZ_qudnZ2d (AT) earthlink (DOT) com:

I sometimes wish there were a property, maybe called Purpose,
where a filename, when saved, could have a memo attached to it.
When one does a dir or via Explorer one sees that property field
in the list as well. MS could have done that years ago.

With Office files, that already exists.

Yes. Looking at google it appears one needs to dl a file called
DSOFile
then registering the ActiveX but I saw mention of Office in some
threads. Not having needed such a capability it is nice to know
it exists.
My FileSearch class module already does that. The bizarro thing is
that the DLL doesn't know anything about the Access
meta-properties.

http://dfenton.com/DFA/download/Access/FileSearch.html

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Reply With Quote
  #26  
Old   
David-W-Fenton
 
Posts: n/a

Default Re: Copy Files with long file names - 10-29-2010 , 05:08 PM



bala <balkiir (AT) gmail (DOT) com> wrote in
news:e6d2a90e-d54a-4b03-8c34-74372be51eeb (AT) s4g2000yql (DOT) googlegroups.com
:

Quote:
Since Windows XP (and I believe Windows 7 too) handles max lenght
of 260 I believe even if we successfully rename and copy any files
with long name the behaviour of the copied file can be
unpredictable.
If things are consistent with the past, the 260 limit is on the full
path and filename, not just the filename itself. That would mean
that a 100-character path could not have files with names over 160
in length and still be accessible.

I wonder, though, if that could be gotten round with the File System
Object by loading the list of files into a collection or array. Or,
if the FSO has a collection where you could access the files by
index and then check the name without the path.

Likely not, since to do anything from there the FSO would still have
to use the full path/name, but it's worth a shot.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Reply With Quote
  #27  
Old   
Benny Andersen
 
Posts: n/a

Default Re: Copy Files with long file names - 10-31-2010 , 03:00 AM



Quote:
I'm pretty certain the Folder Options settings are per user. At a
guess, this information is somewhere in the registry, so you should be
able to control it from code (policy, maybe?). As to individual folders,
the View tab of the Folder Options dialog (Tools | Folder Options from
explorer, also available in Control Panel) has a button to apply the
current view settings to every folder.
if my knowledge isn't obsolete, it is saved in seperate streams - a
rare known NTFS feature. When copied to a fat device the properties is
lost. Some file properties, like exif data to jpg is file content.

Reply With Quote
  #28  
Old   
James A. Fortune
 
Posts: n/a

Default Re: Copy Files with long file names - 11-01-2010 , 10:00 AM



On Oct 27, 5:59*pm, "Stuart McCall" <smcc... (AT) myunrealbox (DOT) com> wrote:
Quote:
"bala" <balk... (AT) gmail (DOT) com> wrote in message

news:9938d961-6015-4e55-b3ad-53a2f2e56115 (AT) y23g2000yqd (DOT) googlegroups.com...
On Oct 27, 5:18 pm, "Stuart McCall" <smcc... (AT) myunrealbox (DOT) com> wrote:



"bala" <balk... (AT) gmail (DOT) com> wrote in message

news:106f1fbf-d6f2-423c-9edd-98aaf46876c4 (AT) l17g2000yqe (DOT) googlegroups.com....
On Oct 27, 4:25 pm, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:

bala wrote:
On Oct 27, 9:35 am, "Jon Lewis" <jon.le... (AT) cutthespambtinternet (DOT) com
wrote:

Can't you get the short file name at runtime to pass to your CopyFile
procedure whilst keeping the full name stored/displayed?

Jon

"bala" <balk... (AT) gmail (DOT) com> wrote in message

news:45a6e5b9-9c49-4e07-af9d-45d4878126b4 (AT) y23g2000yqd (DOT) googlegroups.com...
On Oct 26, 10:42 pm, "Stuart McCall" <smcc... (AT) myunrealbox (DOT) com> wrote:

"bala" <balk... (AT) gmail (DOT) com> wrote in message

news:7836c18b-b7b6-4470-bab6-1b7ffab8f277 (AT) r14g2000yqa (DOT) googlegroups..com...

Hi,

I am using CopyFile (Scripting.FileSystemObject) to copy file from
one
location to another. The naming convention followed makes the file
names (+ the path) lenghty and the total characters can exceed 260
characters.

I would appreciate if you can let me know if there is any solution
to
bypass max limit (Filename + Path) of 260 characters.

The copying of file from one location to another happens on the
click
of a button in MS Access Forms.

Thanks in Advance.

Regards
Bala

Well you can use short file names instead:

http://www.smccall.demon.co.uk/Strin...idequotedtext-

- Show quoted text -

There lies the problem, the clients wants the naming convention to be
followed and the naming convention does creates long names. Any work
around?- Hide quoted text -

- Show quoted text -

That is a good suggestion but the client wants the files to be named
according to the naming convention (translated : long name). According
to them they want to identify the nature of the file by glancing at
the name.

What I also tried is using the short dummy name to copy file using
CopyFile and then tried to rename it with the long name but it didn't
work out.

I have search web and couldn't find any solution for it as Windows XP
as a max limit of 260 characters when NTFS file system can handle upto
32,000 char.

To be honest I think the bottom line is as per Stuart and your
suggestion the File Name (inclusive of the Path) have to be restricted
to less than 240 chars (to be on a safer side). A file name (including
Path) with lenght of 253 Chars also created problem.

If there is any work around well it would be nice if not have to start
the long never ending process of convincing the Client.

Where are you copying the file to; network or C: drive?

What is so long; the filename or the folder name? If folder name, you
can map a drive letter
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.MapNetworkDrive "L:", "\\mydrive\share"

Then you'd copy the file to drive L:

If your filename is 250 chars+, wow!- Hide quoted text -

- Show quoted text -
I am copying the file to network drive and yes it is 250 Chars +. That
is problem. Sometimes there maybe one subfolder or 2 at the max. The
name of the file (following the naming convention) tends to be
long.That is the killer here.

Well if your client insists on sticking with FAT32 file system then the
only
(sensible) solution is to redesign the naming convention. They've
overstepped the mark, unfortunately.- Hide quoted text -

- Show quoted text -
Sorry for the confusion, what the client as is NTFS File System even
then the limitation (Max Lenght of 260) comes into play because of
Windows XP.

OIC. Well they've still overstepped. IMO they need to see if there's a way
to abbreviate at least part(s) of the name while leaving it still
recognisable. After all, as Salad says, it can hardly be 'glanced' as it
stands.
IC2. IMO, the OS file system names are a poor choice as a database
container, even if WinFS pops up someday with some nice OS database
features. It seems that your customer has taken the concept to its
illogical extreme. Many years ago I had a customer that really wanted
data with "clever" enhancements that would enable him to categorize
the data by sight - obviously something to avoid putting into the
actual data from a database perspective. Yet such idiosyncrasies are
typical of the situations asked for by customers. Ideally, you want
to accommodate the customer's desires without resorting to
questionable database practices. I.e., some ingenuity is in order to
accomplish both. I think your customer has passed the point where
satisfying both goals is possible. From my experience, even when
satisfying both goals is possible, using the OS file names as a pseudo
database leads to inefficiencies that increase dramatically over time.

James A. Fortune
CDMAPoster (AT) FortuneJames (DOT) com

Reply With Quote
  #29  
Old   
Stuart McCall
 
Posts: n/a

Default Re: Copy Files with long file names - 11-01-2010 , 12:22 PM



"James A. Fortune" <CDMAPoster (AT) FortuneJames (DOT) com> wrote

On Oct 27, 5:59 pm, "Stuart McCall" <smcc... (AT) myunrealbox (DOT) com> wrote:
Quote:
"bala" <balk... (AT) gmail (DOT) com> wrote in message

news:9938d961-6015-4e55-b3ad-53a2f2e56115 (AT) y23g2000yqd (DOT) googlegroups.com...
On Oct 27, 5:18 pm, "Stuart McCall" <smcc... (AT) myunrealbox (DOT) com> wrote:



"bala" <balk... (AT) gmail (DOT) com> wrote in message

news:106f1fbf-d6f2-423c-9edd-98aaf46876c4 (AT) l17g2000yqe (DOT) googlegroups.com...
On Oct 27, 4:25 pm, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:

bala wrote:
On Oct 27, 9:35 am, "Jon Lewis" <jon.le... (AT) cutthespambtinternet (DOT) com
wrote:

Can't you get the short file name at runtime to pass to your
CopyFile
procedure whilst keeping the full name stored/displayed?

Jon

"bala" <balk... (AT) gmail (DOT) com> wrote in message

news:45a6e5b9-9c49-4e07-af9d-45d4878126b4 (AT) y23g2000yqd (DOT) googlegroups.com...
On Oct 26, 10:42 pm, "Stuart McCall" <smcc... (AT) myunrealbox (DOT) com
wrote:

"bala" <balk... (AT) gmail (DOT) com> wrote in message

news:7836c18b-b7b6-4470-bab6-1b7ffab8f277 (AT) r14g2000yqa (DOT) googlegroups.com...

Hi,

I am using CopyFile (Scripting.FileSystemObject) to copy file from
one
location to another. The naming convention followed makes the file
names (+ the path) lenghty and the total characters can exceed 260
characters.

I would appreciate if you can let me know if there is any solution
to
bypass max limit (Filename + Path) of 260 characters.

The copying of file from one location to another happens on the
click
of a button in MS Access Forms.

Thanks in Advance.

Regards
Bala

Well you can use short file names instead:

http://www.smccall.demon.co.uk/Strin...idequotedtext-

- Show quoted text -

There lies the problem, the clients wants the naming convention to
be
followed and the naming convention does creates long names. Any work
around?- Hide quoted text -

- Show quoted text -

That is a good suggestion but the client wants the files to be named
according to the naming convention (translated : long name).
According
to them they want to identify the nature of the file by glancing at
the name.

What I also tried is using the short dummy name to copy file using
CopyFile and then tried to rename it with the long name but it
didn't
work out.

I have search web and couldn't find any solution for it as Windows
XP
as a max limit of 260 characters when NTFS file system can handle
upto
32,000 char.

To be honest I think the bottom line is as per Stuart and your
suggestion the File Name (inclusive of the Path) have to be
restricted
to less than 240 chars (to be on a safer side). A file name
(including
Path) with lenght of 253 Chars also created problem.

If there is any work around well it would be nice if not have to
start
the long never ending process of convincing the Client.

Where are you copying the file to; network or C: drive?

What is so long; the filename or the folder name? If folder name, you
can map a drive letter
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.MapNetworkDrive "L:", "\\mydrive\share"

Then you'd copy the file to drive L:

If your filename is 250 chars+, wow!- Hide quoted text -

- Show quoted text -
I am copying the file to network drive and yes it is 250 Chars +. That
is problem. Sometimes there maybe one subfolder or 2 at the max. The
name of the file (following the naming convention) tends to be
long.That is the killer here.

Well if your client insists on sticking with FAT32 file system then the
only
(sensible) solution is to redesign the naming convention. They've
overstepped the mark, unfortunately.- Hide quoted text -

- Show quoted text -
Sorry for the confusion, what the client as is NTFS File System even
then the limitation (Max Lenght of 260) comes into play because of
Windows XP.

OIC. Well they've still overstepped. IMO they need to see if there's a way
to abbreviate at least part(s) of the name while leaving it still
recognisable. After all, as Salad says, it can hardly be 'glanced' as it
stands.

IC2. IMO, the OS file system names are a poor choice as a database
container, even if WinFS pops up someday with some nice OS database
features. It seems that your customer has taken the concept to its
illogical extreme. Many years ago I had a customer that really wanted
data with "clever" enhancements that would enable him to categorize
the data by sight - obviously something to avoid putting into the
actual data from a database perspective. Yet such idiosyncrasies are
typical of the situations asked for by customers. Ideally, you want
to accommodate the customer's desires without resorting to
questionable database practices. I.e., some ingenuity is in order to
accomplish both. I think your customer has passed the point where
satisfying both goals is possible. From my experience, even when
satisfying both goals is possible, using the OS file names as a pseudo
database leads to inefficiencies that increase dramatically over time.

James A. Fortune
CDMAPoster (AT) FortuneJames (DOT) com
I know you're not addressing me, but I'd like to say: Well Put.

Reply With Quote
  #30  
Old   
Marshall Barton
 
Posts: n/a

Default Re: Copy Files with long file names - 11-01-2010 , 04:42 PM



James A. Fortune wrote:
Quote:
IC2. IMO, the OS file system names are a poor choice as a database
container, even if WinFS pops up someday with some nice OS database
features. It seems that your customer has taken the concept to its
illogical extreme. Many years ago I had a customer that really wanted
data with "clever" enhancements that would enable him to categorize
the data by sight - obviously something to avoid putting into the
actual data from a database perspective. Yet such idiosyncrasies are
typical of the situations asked for by customers. Ideally, you want
to accommodate the customer's desires without resorting to
questionable database practices. I.e., some ingenuity is in order to
accomplish both. I think your customer has passed the point where
satisfying both goals is possible. From my experience, even when
satisfying both goals is possible, using the OS file names as a pseudo
database leads to inefficiencies that increase dramatically over time.
Amen.

--
Marsh

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.