MACSCRPT Archives

May 2007

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Andreas Kiel <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Tue, 29 May 2007 20:56:36 +0200
Content-Type:
text/plain
Parts/Attachments:
text/plain (70 lines)
Thanks Mark,

The result is: file names with less then 32 characters does show the  
growing size within a repeat loop (while the file is created):

set currentSize to do shell script "stat -f %z " & (quoted form of  
exportFilePath) as string
or
set currentSize to get eof of (posix file exportFilePath)
or
set currentSize to size of (info for (posix file exportFilePath))

longer file name will create a file not found error.

each of the code works fine with any file name when the file is written.

I will try the "ls -s" thing and will let you know.

Thanks
Andreas

On 29.05.2007, at 19:46, Mark Lively wrote:

> What results are you seeing?
>
> There is no real way to know the actual size of a file that is  
> being written.  You can get the allocated size with ls -s
>
> cat /dev/urandom > reallylongfilenameshoopshoopdedoop.dat
>
> $ ls -s reallylongfilenameshoopshoopdedoop.dat
> 8328 reallylongfilenameshoopshoopdedoop.dat
> $ ls -s reallylongfilenameshoopshoopdedoop.dat
> 10064 reallylongfilenameshoopshoopdedoop.dat
> $ls -s reallylongfilenameshoopshoopdedoop.dat
> 15312 reallylongfilenameshoopshoopdedoop.dat
>
>
>
> On May 29, 2007, at 1:21 PM, Andreas Kiel wrote:
>
>> Hi all,
>>
>> I already asked at the ASS list, but it might be better to ask here.
>>
>> I'm a little bit desperate about getting the file size of a busy  
>> file when the file name has more than 31 characters.
>> It always works if the file is written, but not when the file is  
>> busy and that's what I need.
>> I tried a shell script, get eof, size of (info). Always same  
>> behaviour.
>>
>> Anybody any idea why - or how to solve?
>> Sure I could use a temporary name and then re-name the files, but  
>> maybe there is something more elegant.
>>
>> Regards
>> Andreas
>>

Andreas Kiel
Spherico
Nelkenstr. 25
D-76135 Karlsruhe
Tel.: +49 (0)721 183 9753
eFax: +1 650 897 8094

eMail: [log in to unmask]
http://spherico.com/filmtools -- workflow tools for FCP

ATOM RSS1 RSS2