FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 01-24-2009, 12:11 AM
Filipe Brandenburger
 
Default OT? File order on CentOS/Samba server -- SOLVED (kind of...)

Hi,

On Fri, Jan 23, 2009 at 15:29, Miguel Medalha <miguelmedalha@sapo.pt> wrote:
> I am now almost certain that dir_index will solve the problem. I already
> remotely did fsck -fD to that filesystem.

I don't really think so... I believe dir_index is the default, your
filesystem was probably already created with the dir_index option, and
yet your files are out of order. Looking at the man page, it's sorted
by the hash of the filename. The purpose is not to present you the
files in order, but to make it quicker to open a file in a directory
with a huge number of files.

> Now I will have to wait for monday to do the Distiller stuff.

You don't necessarily have to wait to see what the Distiller would do.
"ls -U" shows the files unsorted, in the directory order, that is
probably the order in which the Distiller is using them.

HTH,
Filipe
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-24-2009, 12:45 AM
Filipe Brandenburger
 
Default OT? File order on CentOS/Samba server -- SOLVED (kind of...)

Hi,

You might want to try to look into the Distiller side of things.

1) I believe you are using Rundirex.txt file to convert all the .ps's
into one .pdf. This page from Adobe confirms that it will take the
files in directory order under Windows:

http://kb.adobe.com/selfservice/viewContent.do?externalId=318674
"-- Acrobat Distiller for Windows will process the files in the order
in which you put them into the folder and create the PDF pages in the
order in which it processes the files."
"-- Acrobat Distiller for Mac OS will process the files in alphabetical order."
(one solution would be getting a mac, hehehe).

Strange that you never hit the wrong order problem before, since
according to that page, you should...

2) That page also talks about Runfilex.ps file, which is basically the
same, only you have to list each .ps file in the order you want them
to be included. Any chance you could use this one instead of Rundirex?
Is the list of included files fixed? Could the Runfilex.ps file be
somehow generated on the server based on the list of files that are
there (maybe by a CGI in a web interface) instead of copied by the
guy?

3) From what I see, Rundirex.txt (even with a .txt extension) is a
Postscript file. AFAIK, Postscript is a full programming language,
I've even seen webservers written in Postscript. I'm sure there is a
way to sort the list of files from inside Postscript. However, I don't
know the language and wouldn't know how to do that, or even how to
start looking for it. I searched on the web for someone that did
implement this on Rundirex.txt specifically, but with no luck. Maybe
someone else on the list will know Postscript, or you could try to
look for it in a Postscript list, I'm sure the solution will exist
there.

Good luck! And let us know how you fixed it!

Filipe
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-24-2009, 01:55 AM
Filipe Brandenburger
 
Default OT? File order on CentOS/Samba server -- SOLVED (kind of...)

Hi,

On Fri, Jan 23, 2009 at 20:45, Filipe Brandenburger
<filbranden@gmail.com> wrote:
> 3) Rundirex.txt (even with a .txt extension) is a Postscript file. [...]
> [...] way to sort the list of files from inside Postscript.

I think I did it.

Inside your Rundirex.txt, you should have this snippet:


/RunDir { % Uses PathName variable on the operand stack
{ /mysave save def % Performs a save before running the PS file
dup = flush % Shows name of PS file being run
RunFile % Calls built in Distiller procedure
clear cleardictstack % Cleans up after PS file
mysave restore % Restores save level
}
255 string
filenameforall
} def


Right? If so, then add the definition of a bubble sort routine before
that (which I got from Wikipedia), and then modify /RunDir into the
snippet below. Ghostscript has a .sort built-in that does exaclty
that, but I'm including it here as I don't know if Distiller will too.


% Bubble sort from Wikibooks page on PostScript
/mybubblesort
{ 1 index length 1 sub -1 1
{ 2 index exch 2 copy get 3 copy % arr proc arr i arr[i] arr i arr[i]
0 1 3 index 1 sub
{ 3 index 1 index get % arr proc arr i arr[i] arr
imax amax j arr[j]
2 index 1 index 10 index exec
{ % ... amax < arr[j]
4 2 roll
}
if pop pop
}
for % arr proc arr i
arr[i] arr imax amax
4 -1 roll exch 4 1 roll put put
}
for
pop
} bind def

/RunDir { % Uses PathName variable on the operand stack
/nf 0 def % Reset counter for number of files
{ 255 string copy % Copy to a separate string (otherwise
would be overwritten)
/nf nf 1 add def % Increment counter of number of files
}
255 string
filenameforall

nf array astore % Put all filenames in an array
{ lt } mybubblesort % And sort it

{ /mysave save def % Performs a save before running the PS file
dup = flush % Shows name of PS file being run
RunFile % Calls built in Distiller procedure
clear cleardictstack % Cleans up after PS file
mysave restore % Restores save level
}
forall % Execute original procedure, but
using sorted array
} def


Of course I did not test it with Distiller which I don't have... I did
test the part of sorting the list of files with Ghostscript and it
works.

Maybe word wrapping in the e-mail will ruin the snippet, if that's the
case please let me know and I'll send it attached to you.

Let us know if that works!

Filipe
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-24-2009, 07:14 PM
Ross Walker
 
Default OT? File order on CentOS/Samba server -- SOLVED (kind of...)

On Sat, Jan 24, 2009 at 12:43 PM, Miguel Medalha <miguelmedalha@sapo.pt> wrote:
>
>> again, Windows NTFS directories are inherently stored in sorted order
>> because they are B-Tree indexes on the filename.
>>
>> if this distiller process is being run from a "DOS" batch job in
>> Windows, you could perhaps use something like...
>>
>> for /f %%F in ('dir /b /on *.ps') DO @path odistiller .... %%F ....
>>
>> to run it on all *.ps files in the current working directory in
>> alphabetic order.
>>
>
> Please note that what Distiller is doing is not "run on all *.ps files
> in alphabetic order". If only that were the case, I wouldn't be here
> bothering people...
> Instructed by a special PS file, Distiller is running a set of complex
> operations on a group of files in alphabetic order.
>
> I can modify that special PS file to make Distiller process the files in
> any order I want.
> The problem is that when the order is not provided by the filesystem
> itself, the process takes forever.
> That's why I was looking for a solution at the filesystem level. I was
> trying to understand the inner workings of EXT3 and looking for a
> workaround.
>
> Thank you for your tip, though. Maybe some day I will need it.

Have you tried what the different codepages do to sort order in Samba?

Check out these options:

dos charset
unix charset
display charset

-Ross
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 04:26 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org